<!DOCTYPE html><html><head>
      <title>C#&#x5B66;&#x4E60;&#x7B14;&#x8BB0;</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css">
      
      
      
      
      
      
      
      
      
      <style>
      /**
 * prism.js Github theme based on GitHub's theme.
 * @author Sam Clarke
 */
code[class*="language-"],
pre[class*="language-"] {
  color: #333;
  background: none;
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.4;

  -moz-tab-size: 8;
  -o-tab-size: 8;
  tab-size: 8;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  padding: .8em;
  overflow: auto;
  /* border: 1px solid #ddd; */
  border-radius: 3px;
  /* background: #fff; */
  background: #f5f5f5;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: .1em;
  border-radius: .3em;
  white-space: normal;
  background: #f5f5f5;
}

.token.comment,
.token.blockquote {
  color: #969896;
}

.token.cdata {
  color: #183691;
}

.token.doctype,
.token.punctuation,
.token.variable,
.token.macro.property {
  color: #333;
}

.token.operator,
.token.important,
.token.keyword,
.token.rule,
.token.builtin {
  color: #a71d5d;
}

.token.string,
.token.url,
.token.regex,
.token.attr-value {
  color: #183691;
}

.token.property,
.token.number,
.token.boolean,
.token.entity,
.token.atrule,
.token.constant,
.token.symbol,
.token.command,
.token.code {
  color: #0086b3;
}

.token.tag,
.token.selector,
.token.prolog {
  color: #63a35c;
}

.token.function,
.token.namespace,
.token.pseudo-element,
.token.class,
.token.class-name,
.token.pseudo-class,
.token.id,
.token.url-reference .token.variable,
.token.attr-name {
  color: #795da3;
}

.token.entity {
  cursor: help;
}

.token.title,
.token.title .token.punctuation {
  font-weight: bold;
  color: #1d3e81;
}

.token.list {
  color: #ed6a43;
}

.token.inserted {
  background-color: #eaffea;
  color: #55a532;
}

.token.deleted {
  background-color: #ffecec;
  color: #bd2c00;
}

.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}


/* JSON */
.language-json .token.property {
  color: #183691;
}

.language-markup .token.tag .token.punctuation {
  color: #333;
}

/* CSS */
code.language-css,
.language-css .token.function {
  color: #0086b3;
}

/* YAML */
.language-yaml .token.atrule {
  color: #63a35c;
}

code.language-yaml {
  color: #183691;
}

/* Ruby */
.language-ruby .token.function {
  color: #333;
}

/* Markdown */
.language-markdown .token.url {
  color: #795da3;
}

/* Makefile */
.language-makefile .token.symbol {
  color: #795da3;
}

.language-makefile .token.variable {
  color: #183691;
}

.language-makefile .token.builtin {
  color: #0086b3;
}

/* Bash */
.language-bash .token.keyword {
  color: #0086b3;
}

/* highlight */
pre[data-line] {
  position: relative;
  padding: 1em 0 1em 3em;
}
pre[data-line] .line-highlight-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  background-color: transparent;
  display: block;
  width: 100%;
}

pre[data-line] .line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  padding: inherit 0;
  margin-top: 1em;
  background: hsla(24, 20%, 50%,.08);
  background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
  pointer-events: none;
  line-height: inherit;
  white-space: pre;
}

pre[data-line] .line-highlight:before, 
pre[data-line] .line-highlight[data-end]:after {
  content: attr(data-start);
  position: absolute;
  top: .4em;
  left: .6em;
  min-width: 1em;
  padding: 0 .5em;
  background-color: hsla(24, 20%, 50%,.4);
  color: hsl(24, 20%, 95%);
  font: bold 65%/1.5 sans-serif;
  text-align: center;
  vertical-align: .3em;
  border-radius: 999px;
  text-shadow: none;
  box-shadow: 0 1px white;
}

pre[data-line] .line-highlight[data-end]:after {
  content: attr(data-end);
  top: auto;
  bottom: .4em;
}html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ul,html body>ol{margin-bottom:16px}html body ul,html body ol{padding-left:2em}html body ul.no-list,html body ol.no-list{padding:0;list-style-type:none}html body ul ul,html body ul ol,html body ol ol,html body ol ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:bold;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em !important;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::before,html body code::after{letter-spacing:-0.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em !important;word-break:normal;white-space:pre;background:transparent;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em !important;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:before,html body pre tt:before,html body pre code:after,html body pre tt:after{content:normal}html body p,html body blockquote,html body ul,html body ol,html body dl,html body pre{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body pre,html body code{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .pagebreak,.markdown-preview .newpage{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{padding:0 1.6em;margin-top:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li{margin-bottom:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{list-style-type:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% -  300px);padding:2em calc(50% - 457px -  150px);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
.markdown-preview.markdown-preview {
  color: #010101;
  background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%);
  background-size: 20px 20px;
  background-position: center center;
  font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
.markdown-preview.markdown-preview h1,
.markdown-preview.markdown-preview h2,
.markdown-preview.markdown-preview h3,
.markdown-preview.markdown-preview h4,
.markdown-preview.markdown-preview h5 {
  color: #35b378;
}
.markdown-preview.markdown-preview .language-ruby {
  background: #f1f3f2;
}
.markdown-preview.markdown-preview blockquote {
  border-left: 4px solid #35b378;
  background: rgba(64, 184, 250, 0.1);
}
.markdown-preview.markdown-preview blockquote code {
  background: rgba(64, 184, 250, 0);
}

      </style>
    </head>
    <body for="html-export">
      <div class="mume markdown-preview  ">
      <ul>
<li><a href="#c-%E5%AD%A6%E4%B9%A0">c# &#x5B66;&#x4E60;</a><br>
- <a href="#%E4%B8%80-%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE">&#x4E00;&#x3001;&#x521B;&#x5EFA;&#x9879;&#x76EE;&#xFF1A;</a><br>
- <a href="#%E4%BA%8C-hello-world">&#x4E8C;&#x3001;Hello  world&#xFF1A;</a><br>
- <a href="#%E4%B8%89-%E7%94%9F%E6%88%90%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88">&#x4E09;&#x3001;&#x751F;&#x6210;&#x89E3;&#x51B3;&#x65B9;&#x6848;</a><br>
- <a href="#%E5%9B%9B-%E9%A1%B9%E7%9B%AE%E7%9A%84%E5%8A%A0%E8%BD%BD%E5%92%8C%E5%8D%B8%E8%BD%BD">&#x56DB;&#x3001;&#x9879;&#x76EE;&#x7684;&#x52A0;&#x8F7D;&#x548C;&#x5378;&#x8F7D;</a><br>
- <a href="#%E4%BA%94-%E8%AE%BE%E7%BD%AE%E8%BF%90%E8%A1%8C%E5%BD%93%E5%89%8D%E9%80%89%E5%AE%9A%E5%86%85%E5%AE%B9">&#x4E94;&#x3001;&#x8BBE;&#x7F6E;&#x8FD0;&#x884C;&#x5F53;&#x524D;&#x9009;&#x5B9A;&#x5185;&#x5BB9;</a><br>
- <a href="#%E5%85%AD-%E6%B3%A8%E9%87%8A%E7%AC%A6">&#x516D;&#x3001;&#x6CE8;&#x91CA;&#x7B26;</a><br>
- <a href="#%E4%B8%83-vs%E4%B8%AD%E5%B8%B8%E7%94%A8%E7%9A%84%E5%BF%AB%E6%8D%B7%E9%94%AE">&#x4E03;&#x3001;VS&#x4E2D;&#x5E38;&#x7528;&#x7684;&#x5FEB;&#x6377;&#x952E;</a><br>
- <a href="#%E5%85%AB-%E5%8F%98%E9%87%8F%E7%9A%84%E4%BD%BF%E7%94%A8%E8%A7%84%E5%88%99">&#x516B;&#x3001;&#x53D8;&#x91CF;&#x7684;&#x4F7F;&#x7528;&#x89C4;&#x5219;</a><br>
- <a href="#%E4%B9%9D-%E8%B5%8B%E5%80%BC%E8%BF%90%E7%AE%97%E7%AC%A6">&#x4E5D;&#x3001;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;</a><br>
- <a href="#%E5%8D%81-%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%8B%BC%E6%8E%A5">&#x5341;&#x3001;&#x5B57;&#x7B26;&#x4E32;&#x62FC;&#x63A5;</a><br>
- <a href="#%E5%8D%81%E4%B8%80-%E5%8D%A0%E4%BD%8D%E7%AC%A6%E7%9A%84%E4%BD%BF%E7%94%A8">&#x5341;&#x4E00;&#x3001;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x4F7F;&#x7528;</a><br>
- <a href="#%E5%8D%81%E4%BA%8C-%E5%88%9B%E5%BB%BA%E5%86%85%E6%8F%92%E5%AD%97%E7%AC%A6%E4%B8%B2">&#x5341;&#x4E8C;&#x3001;&#x521B;&#x5EFA;&#x5185;&#x63D2;&#x5B57;&#x7B26;&#x4E32;</a><br>
- <a href="#%E5%8D%81%E4%B8%89-%E4%BA%A4%E6%8D%A2%E5%8F%98%E9%87%8F">&#x5341;&#x4E09;&#x3001;&#x4EA4;&#x6362;&#x53D8;&#x91CF;</a><br>
- <a href="#%E5%8D%81%E5%9B%9B-%E6%8E%A5%E6%94%B6%E7%94%A8%E6%88%B7%E6%94%B6%E5%85%A5%E7%9A%84%E5%80%BC">&#x5341;&#x56DB;&#x3001;&#x63A5;&#x6536;&#x7528;&#x6237;&#x6536;&#x5165;&#x7684;&#x503C;</a><br>
- <a href="#%E5%8D%81%E4%BA%94-%E8%BD%AC%E4%B9%89%E7%AC%A6%E5%92%8C%E7%AC%A6%E5%8F%B7%E7%9A%84%E4%BD%9C%E7%94%A8">&#x5341;&#x4E94;&#x3001;&#x8F6C;&#x4E49;&#x7B26;&#x548C;@&#x7B26;&#x53F7;&#x7684;&#x4F5C;&#x7528;</a><br>
- <a href="#%E5%8D%81%E5%85%AD-%E7%AE%97%E6%9C%AF%E8%BF%90%E7%AE%97%E7%AC%A6%E5%8F%8A%E7%AE%97%E6%9C%AF%E8%A1%A8%E8%BE%BE%E5%BC%8F">&#x5341;&#x516D;&#x3001;&#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x7B26;&#x53CA;&#x7B97;&#x672F;&#x8868;&#x8FBE;&#x5F0F;</a><br>
- <a href="#%E5%8D%81%E4%B8%83-%E6%98%BE%E7%A4%BA%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2%E5%92%8C%E9%9A%90%E5%BC%8F%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2">&#x5341;&#x4E03;&#x3001;&#x663E;&#x793A;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x548C;&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</a><br>
- <a href="#%E5%8D%81%E5%85%AB-convert%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2">&#x5341;&#x516B;&#x3001;Convert&#x7C7B;&#x578B;&#x8F6C;&#x6362;</a><br>
- <a href="#%E5%8D%81%E4%B9%9D-%E5%8A%A0%E5%8A%A0%E5%87%8F%E5%87%8F">&#x5341;&#x4E5D;&#x3001;&#x52A0;&#x52A0;&#x51CF;&#x51CF;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81-%E5%85%B3%E7%B3%BB%E8%BF%90%E7%AE%97%E7%AC%A66%E4%B8%AA">&#x4E8C;&#x5341;&#x3001;&#x5173;&#x7CFB;&#x8FD0;&#x7B97;&#x7B26;(6&#x4E2A;)</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E4%B8%80-%E9%80%BB%E8%BE%91%E8%BF%90%E7%AE%97%E7%AC%A63%E4%B8%AA">&#x4E8C;&#x5341;&#x4E00;&#x3001;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;(3&#x4E2A;)</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E4%BA%8C-%E5%A4%8D%E5%90%88%E8%B5%8B%E5%80%BC%E8%BF%90%E7%AE%97%E7%AC%A65%E4%B8%AA">&#x4E8C;&#x5341;&#x4E8C;&#x3001;&#x590D;&#x5408;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;(5&#x4E2A;)</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E4%B8%89-%E7%A8%8B%E5%BA%8F%E7%BB%93%E6%9E%84">&#x4E8C;&#x5341;&#x4E09;&#x3001;&#x7A0B;&#x5E8F;&#x7ED3;&#x6784;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E5%9B%9B-if%E8%AF%AD%E5%8F%A5">&#x4E8C;&#x5341;&#x56DB;&#x3001;if&#x8BED;&#x53E5;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E4%BA%94-if-else%E8%AF%AD%E5%8F%A5">&#x4E8C;&#x5341;&#x4E94;&#x3001;if-else&#x8BED;&#x53E5;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E5%85%AD-%E5%BC%82%E5%B8%B8%E6%8D%95%E8%8E%B7">&#x4E8C;&#x5341;&#x516D;&#x3001;&#x5F02;&#x5E38;&#x6355;&#x83B7;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E4%B8%83-switch-case%E8%AF%AD%E5%8F%A5">&#x4E8C;&#x5341;&#x4E03;&#x3001;switch-case&#x8BED;&#x53E5;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E5%85%AB-%E5%BE%AA%E7%8E%AF%E7%BB%93%E6%9E%84-while%E5%BE%AA%E7%8E%AF">&#x4E8C;&#x5341;&#x516B;&#x3001;&#x5FAA;&#x73AF;&#x7ED3;&#x6784;   while&#x5FAA;&#x73AF;</a><br>
- <a href="#%E4%BA%8C%E5%8D%81%E4%B9%9D-break%E7%9A%84%E7%94%A8%E6%B3%95">&#x4E8C;&#x5341;&#x4E5D;&#x3001;break&#x7684;&#x7528;&#x6CD5;</a><br>
- <a href="#%E4%B8%89%E5%8D%81-do-while%E5%BE%AA%E7%8E%AF">&#x4E09;&#x5341;&#x3001;do-while&#x5FAA;&#x73AF;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E4%B8%80-%E7%A8%8B%E5%BA%8F%E8%B0%83%E8%AF%95">&#x4E09;&#x5341;&#x4E00;&#x3001;&#x7A0B;&#x5E8F;&#x8C03;&#x8BD5;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E4%BA%8C-for%E5%BE%AA%E7%8E%AF">&#x4E09;&#x5341;&#x4E8C;&#x3001;for&#x5FAA;&#x73AF;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E4%B8%89-intparse">&#x4E09;&#x5341;&#x4E09;&#x3001;int.Parse</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E5%9B%9B-continue">&#x4E09;&#x5341;&#x56DB;&#x3001;Continue</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E4%BA%94-%E4%B8%89%E5%85%83%E8%A1%A8%E8%BE%BE%E5%BC%8F">&#x4E09;&#x5341;&#x4E94;&#x3001;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E5%85%AD-%E9%9A%8F%E6%9C%BA%E6%95%B0">&#x4E09;&#x5341;&#x516D;&#x3001;&#x968F;&#x673A;&#x6570;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E4%B8%83-%E5%B8%B8%E9%87%8F">&#x4E09;&#x5341;&#x4E03;&#x3001;&#x5E38;&#x91CF;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E5%85%AB-%E6%9E%9A%E4%B8%BE">&#x4E09;&#x5341;&#x516B;&#x3001;&#x679A;&#x4E3E;</a><br>
- <a href="#%E4%B8%89%E5%8D%81%E4%B9%9D-%E6%9E%9A%E4%B8%BE%E7%B1%BB%E5%9E%8B%E5%92%8Cstring%E4%BB%A5%E5%8F%8Aint%E4%B9%8B%E9%97%B4%E7%9A%84%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2">&#x4E09;&#x5341;&#x4E5D;&#x3001;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x548C;string&#x4EE5;&#x53CA;int&#x4E4B;&#x95F4;&#x7684;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</a><br>
- <a href="#%E5%9B%9B%E5%8D%81-%E7%BB%93%E6%9E%84">&#x56DB;&#x5341;&#x3001;&#x7ED3;&#x6784;</a><br>
- <a href="#%E5%9B%9B%E5%8D%81%E4%B8%80-%E6%95%B0%E7%BB%84%E7%9A%84%E5%AE%9A%E4%B9%89">&#x56DB;&#x5341;&#x4E00;&#x3001;&#x6570;&#x7EC4;&#x7684;&#x5B9A;&#x4E49;</a><br>
- <a href="#%E5%9B%9B%E5%8D%81%E4%BA%8C-%E6%95%B0%E7%BB%84%E7%9A%84%E5%BA%94%E7%94%A8">&#x56DB;&#x5341;&#x4E8C;&#x3001;&#x6570;&#x7EC4;&#x7684;&#x5E94;&#x7528;</a></li>
</ul>
<h1 class="mume-header" id="c-%E5%AD%A6%E4%B9%A0">c# &#x5B66;&#x4E60;</h1>

<h5 class="mume-header" id="%E4%B8%80-%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE">&#x4E00;&#x3001;&#x521B;&#x5EFA;&#x9879;&#x76EE;&#xFF1A;</h5>

<ul>
<li>1&#x3001;&#x4E09;&#x8005;&#x5173;&#x7CFB;&#xFF1A;&#x89E3;&#x51B3;&#x65B9;&#x6848; &#x5305;&#x542B; &#x9879;&#x76EE; &#x5305;&#x542B; &#x7C7B;</li>
<li>2&#x3001;&#x4EE5; .cs &#x7ED3;&#x5C3E;&#x7684;&#x6587;&#x4EF6;&#x6211;&#x4EEC;&#x79F0;&#x4E4B;&#x4E3A;&#x7C7B;&#x6587;&#x4EF6;</li>
<li>3&#x3001;&#x6DFB;&#x52A0;&#x9879;&#x76EE;&#x6B65;&#x9AA4;&#xFF1A;&#x9009;&#x4E2D;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x53F3;&#x952E;&#x65B0;&#x5EFA;&#x9879;&#x76EE;</li>
<li>4&#x3001;&#x6DFB;&#x52A0;&#x7C7B;&#x6587;&#x4EF6;&#x6B65;&#x9AA4;&#xFF1A;&#x9009;&#x4E2D;&#x9879;&#x76EE;&#x53F3;&#x952E;&#x6DFB;&#x52A0;&#x7C7B;</li>
<li>5&#x3001;program&#x4E2D;&#x7684;&#x5404;&#x4E2A;&#x7EC4;&#x6210;&#x90E8;&#x5206;&#xFF1A;
<ul>
<li>
<p>5.1&#x3001;&#x5F15;&#x7528;&#x547D;&#x540D;&#x7A7A;&#x95F4;<br>
&#x4EAC;&#x4E1C;-----&gt;&#x4EAC;&#x4E1C;&#x5546;&#x57CE;&#x9879;&#x76EE;----&gt;&#x987E;&#x5BA2;&#x7C7B;<br>
&#x6DD8;&#x5B9D;-----&gt;&#x6DD8;&#x5B9D;&#x5546;&#x57CE;&#x9879;&#x76EE;----&gt;&#x987E;&#x5BA2;&#x7C7B;</p>
</li>
<li>
<p>5.2&#x3001;&#x65B9;&#x6CD5;&#x6216;&#x8005;&#x51FD;&#x6570;<br>
Main&#x51FD;&#x6570;&#x662F;&#x6211;&#x4EEC;&#x7A0B;&#x5E8F;&#x7684;&#x4E3B;&#x5165;&#x53E3;</p>
</li>
</ul>
</li>
</ul>
<blockquote>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/Y1XcCrYhoqveLxX4ia2U7iaEib0QtcNsnoRR5zLACUghBj7h1DCQrzrHicw91yWAXxFqHW1LZ1UrdydysTXv58A8rQ/0?wx_fmt=png" alt></p>
</blockquote>
<ul>
<li>6&#x3001;<mark>.sln</mark>&#xFF1A;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x6587;&#x4EF6;&#xFF0C;&#x91CC;&#x9762;&#x5305;&#x542B;&#x7740;&#x6574;&#x4E2A;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x7684;&#x4FE1;&#x606F;&#xFF0C;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x53CC;&#x51FB;&#x8FD0;&#x884C;&#x3002;</li>
<li>7&#x3001;<mark>.csproj</mark>&#xFF1A;&#x9879;&#x76EE;&#x6587;&#x4EF6;&#xFF0C;&#x91CC;&#x9762;&#x5305;&#x542B;&#x7740;&#x6574;&#x4E2A;&#x9879;&#x76EE;&#x7684;&#x4FE1;&#x606F;&#xFF0C;&#x53EF;&#x4EE5;&#x53CC;&#x51FB;&#x8FD0;&#x884C;&#x3002;</li>
</ul>
<h5 class="mume-header" id="%E4%BA%8C-hello-world">&#x4E8C;&#x3001;Hello  world&#xFF1A;</h5>

<ul>
<li>1&#x3001;&#x5728;C#&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x90FD;&#x4EE5;&#x5206;&#x53F7;&#x7ED3;&#x675F;&#x3002;</li>
<li>2&#x3001;&#x8FD0;&#x884C;&#x7A0B;&#x5E8F;&#x7684;&#x4E24;&#x79CD;&#x65B9;&#x5F0F;&#xFF1A;
<ul>
<li>&#x70B9;&#x51FB;&#x7EFF;&#x8272;&#x7684;&#x542F;&#x52A8;&#x6309;&#x94AE;</li>
<li>&#x5FEB;&#x6377;&#x952E;F5</li>
</ul>
</li>
</ul>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">namespace _01_myFirstDemo
<span class="token punctuation">{</span>
    <span class="token keyword">class</span> <span class="token class-name">Program</span>
    <span class="token punctuation">{</span>
        static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;Hello World&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x4EE3;&#x7801;&#x89E3;&#x91CA;&#xFF1A;<br>
<code>Console.WriteLine(&quot;&#x8981;&#x6253;&#x5370;&#x7684;&#x5185;&#x5BB9;&quot;);</code><br>
<code>Console.ReadKey();</code><br>
&#x6682;&#x505C;&#x5F53;&#x524D;&#x7A0B;&#x5E8F;&#xFF0C;&#x7B49;&#x5F85;&#x7528;&#x6237;&#x6309;&#x4E0B;&#x4EFB;&#x610F;&#x952E;&#x7EE7;&#x7EED;&#xFF0C;&#x6309;&#x4E0B;&#x7684;&#x4EFB;&#x610F;&#x952E;&#x5C06;&#x663E;&#x793A;&#x5728;&#x6211;&#x4EEC;&#x7684;&#x63A7;&#x5236;&#x53F0;&#x5F53;&#x4E2D;&#x3002;</p>
</blockquote>
<h5 class="mume-header" id="%E4%B8%89-%E7%94%9F%E6%88%90%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88">&#x4E09;&#x3001;&#x751F;&#x6210;&#x89E3;&#x51B3;&#x65B9;&#x6848;</h5>

<blockquote>
<p>&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x6211;&#x4EEC;&#x6392;&#x67E5;&#x8BED;&#x6CD5;&#x9519;&#x8BEF;&#xFF0C;&#x5FEB;&#x6377;&#x952E; <code>Ctrl+Shift+B/F6</code></p>
</blockquote>
<h5 class="mume-header" id="%E5%9B%9B-%E9%A1%B9%E7%9B%AE%E7%9A%84%E5%8A%A0%E8%BD%BD%E5%92%8C%E5%8D%B8%E8%BD%BD">&#x56DB;&#x3001;&#x9879;&#x76EE;&#x7684;&#x52A0;&#x8F7D;&#x548C;&#x5378;&#x8F7D;</h5>

<blockquote>
<p>&#x9009;&#x4E2D;&#x9879;&#x76EE;&#x53F3;&#x952E;&#x52A0;&#x8F7D;/&#x5378;&#x8F7D;&#x9879;&#x76EE;</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%94-%E8%AE%BE%E7%BD%AE%E8%BF%90%E8%A1%8C%E5%BD%93%E5%89%8D%E9%80%89%E5%AE%9A%E5%86%85%E5%AE%B9">&#x4E94;&#x3001;&#x8BBE;&#x7F6E;&#x8FD0;&#x884C;&#x5F53;&#x524D;&#x9009;&#x5B9A;&#x5185;&#x5BB9;</h5>

<blockquote>
<p>vs&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7B2C;&#x4E00;&#x4E2A;&#x9879;&#x76EE;&#xFF0C;&#x8FD0;&#x884C;&#x5F53;&#x524D;&#x9009;&#x5B9A;&#x5185;&#x5BB9;&#x64CD;&#x4F5C;&#x6B65;&#x9AA4;&#xFF1A;&#x9009;&#x4E2D;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x53F3;&#x952E;&#x70B9;&#x51FB;&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x2018;&#x5F53;&#x524D;&#x9009;&#x5B9A;&#x5185;&#x5BB9;&#x2019;&#x70B9;&#x51FB;&#x786E;&#x5B9A;&#x5373;&#x53EF;&#x3002;</p>
</blockquote>
<h5 class="mume-header" id="%E5%85%AD-%E6%B3%A8%E9%87%8A%E7%AC%A6">&#x516D;&#x3001;&#x6CE8;&#x91CA;&#x7B26;</h5>

<blockquote>
<p>&#x4F5C;&#x7528;&#xFF1A;&#x89E3;&#x91CA;&#x3001;&#x6CE8;&#x9500;</p>
</blockquote>
<ul>
<li>c#&#x7684;3&#x79CD;&#x6CE8;&#x91CA;&#x7B26;
<ul>
<li>1&#x3001;&#x5355;&#x884C;&#x6CE8;&#x91CA; //</li>
<li>2&#x3001;&#x591A;&#x884C;&#x6CE8;&#x91CA; /*&#x8981;&#x6CE8;&#x91CA;&#x7684;&#x5185;&#x5BB9;*/</li>
<li>3&#x3001;&#x6587;&#x6863;&#x6CE8;&#x91CA; ///&#x591A;&#x7528;&#x6765;&#x6CE8;&#x91CA;&#x7C7B;&#x6216;&#x8005;&#x65B9;&#x6CD5;</li>
</ul>
</li>
</ul>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers"><span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span>summary<span class="token operator">&gt;</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> &#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x7684;&#x4F5C;&#x7528;&#x5C31;&#x662F;&#x6C42;&#x4E24;&#x4E2A;&#x6574;&#x6570;&#x4E4B;&#x95F4;&#x7684;&#x6700;&#x5927;&#x503C;
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span><span class="token operator">/</span>summary<span class="token operator">&gt;</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span>param name<span class="token operator">=</span><span class="token string">&quot;n1&quot;</span><span class="token operator">&gt;</span>&#x7B2C;&#x4E00;&#x4E2A;&#x6574;&#x6570;<span class="token operator">&lt;</span><span class="token operator">/</span>param<span class="token operator">&gt;</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span>param name<span class="token operator">=</span><span class="token string">&quot;n2&quot;</span><span class="token operator">&gt;</span>&#x7B2C;&#x4E8C;&#x4E2A;&#x6574;&#x6570;<span class="token operator">&lt;</span><span class="token operator">/</span>param<span class="token operator">&gt;</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span>returns<span class="token operator">&gt;</span>&#x8FD4;&#x56DE;&#x6BD4;&#x8F83;&#x5927;&#x7684;&#x90A3;&#x4E2A;&#x6574;&#x6570;<span class="token operator">&lt;</span><span class="token operator">/</span>returns<span class="token operator">&gt;</span>
<span class="token keyword">public</span> static int <span class="token constant">GetMax</span><span class="token punctuation">(</span>int n1<span class="token punctuation">,</span>int n2<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">return</span> n1 <span class="token operator">&gt;</span> n2 <span class="token operator">?</span> n1 <span class="token punctuation">:</span> n2<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers"><span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span>summary<span class="token operator">&gt;</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> &#x8FD9;&#x4E2A;&#x7C7B;&#x7528;&#x6765;&#x63CF;&#x8FF0;&#x4E00;&#x4E2A;&#x4EBA;&#x7684;&#x4FE1;&#x606F; &#x4ECE;&#x59D3;&#x540D; &#x5E74;&#x9F84;&#x6765;&#x63CF;&#x8FF0;
<span class="token operator">/</span><span class="token operator">/</span><span class="token operator">/</span> <span class="token operator">&lt;</span><span class="token operator">/</span>summary<span class="token operator">&gt;</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Person</span>
<span class="token punctuation">{</span>
    <span class="token keyword">public</span> string <span class="token constant">Name</span>
    <span class="token punctuation">{</span>
        get<span class="token punctuation">;</span>
        set<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">public</span> int <span class="token constant">Age</span>
    <span class="token punctuation">{</span>
        get<span class="token punctuation">;</span>
        set<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%83-vs%E4%B8%AD%E5%B8%B8%E7%94%A8%E7%9A%84%E5%BF%AB%E6%8D%B7%E9%94%AE">&#x4E03;&#x3001;VS&#x4E2D;&#x5E38;&#x7528;&#x7684;&#x5FEB;&#x6377;&#x952E;</h5>

<ul>
<li>Ctrl+K+D  &#x5FEB;&#x901F;&#x5BF9;&#x9F50;&#x4EE3;&#x7801;</li>
<li>Ctrl+Z    &#x64A4;&#x9500;</li>
<li>Ctrl+S    &#x4FDD;&#x5B58;</li>
<li>Ctrl+J    &#x5FEB;&#x901F;&#x5F39;&#x51FA;&#x667A;&#x80FD;&#x63D0;&#x793A;</li>
<li>Shift+End</li>
<li>Shift+Home</li>
<li>Ctrl+K+C  &#x6CE8;&#x91CA;&#x6240;&#x9009;&#x4EE3;&#x7801;</li>
<li>Ctrl+K+U  &#x53D6;&#x6D88;&#x5BF9;&#x6240;&#x9009;&#x4EE3;&#x7801;&#x7684;&#x6CE8;&#x91CA;</li>
<li>F1        &#x8F6C;&#x5230;&#x5E2E;&#x52A9;&#x6587;&#x6863;</li>
<li>&#x6298;&#x53E0;&#x5197;&#x4F59;&#x4EE3;&#x7801;  #Region &#x548C; #EndRegion</li>
</ul>
<h5 class="mume-header" id="%E5%85%AB-%E5%8F%98%E9%87%8F%E7%9A%84%E4%BD%BF%E7%94%A8%E8%A7%84%E5%88%99">&#x516B;&#x3001;&#x53D8;&#x91CF;&#x7684;&#x4F7F;&#x7528;&#x89C4;&#x5219;</h5>

<blockquote>
<p><strong>&#x53D8;&#x91CF;&#x7684;&#x4F7F;&#x7528;&#x89C4;&#x5219;&#xFF1A;</strong><br>
&#x5982;&#x679C;&#x4F60;&#x8981;&#x4F7F;&#x7528;&#x53D8;&#x91CF;&#x7684;&#x8BDD;&#xFF0C;&#x5E94;&#x8BE5;&#x8981;&#x5148;&#x58F0;&#x660E;&#x518D;&#x8D4B;&#x503C;&#x518D;&#x4F7F;&#x7528;&#x3002;<br>
C#&#x4E2D;&#x5927;&#x5C0F;&#x5199;&#x662F;&#x654F;&#x611F;&#x7684;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token operator">/</span><span class="token operator">/</span>&#x58F0;&#x660E;&#x6216;&#x8005;&#x5B9A;&#x4E49;&#x4E86;&#x6574;&#x6570;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;
        number <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span>
        int number<span class="token punctuation">;</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>number<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B9%9D-%E8%B5%8B%E5%80%BC%E8%BF%90%E7%AE%97%E7%AC%A6">&#x4E5D;&#x3001;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;</h5>

<blockquote>
<p>&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;   = &#x8868;&#x793A;&#x628A;&#x7B49;&#x53F7;&#x53F3;&#x8FB9;&#x7684;&#x503C;&#x8D4B;&#x503C;&#x7ED9;&#x7B49;&#x53F7;&#x5DE6;&#x8FB9;&#x7684;&#x53D8;&#x91CF;&#x3002;<br>
&#x7531;&#x7B49;&#x53F7;&#x8FDE;&#x63A5;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#x79F0;&#x4E4B;&#x4E3A;&#x8D4B;&#x503C;&#x8868;&#x8FBE;&#x5F0F;&#x3002;<br>
<code>int number = 10;</code></p>
</blockquote>
<h5 class="mume-header" id="%E5%8D%81-%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%8B%BC%E6%8E%A5">&#x5341;&#x3001;&#x5B57;&#x7B26;&#x4E32;&#x62FC;&#x63A5;</h5>

<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string name <span class="token operator">=</span> <span class="token string">&quot;&#x5361;&#x5361;&#x897F;&quot;</span><span class="token punctuation">;</span>
    int age <span class="token operator">=</span> <span class="token number">30</span><span class="token punctuation">;</span>
    string email <span class="token operator">=</span> <span class="token string">&quot;kakaxi@qq.com&quot;</span><span class="token punctuation">;</span>
    string adress <span class="token operator">=</span> <span class="token string">&quot;&#x706B;&#x5F71;&#x6751;&quot;</span><span class="token punctuation">;</span>
    decimal salary <span class="token operator">=</span> <span class="token number">5000</span>m<span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6211;&#x53EB;&quot;</span><span class="token operator">+</span>name<span class="token operator">+</span><span class="token string">&quot;&#x6211;&#x4F4F;&#x5728;&quot;</span><span class="token operator">+</span>adress<span class="token operator">+</span><span class="token string">&quot;&#x6211;&#x4ECA;&#x5E74;&quot;</span><span class="token operator">+</span>age<span class="token operator">+</span><span class="token string">&quot;&#x5C81;&#x4E86;&quot;</span><span class="token operator">+</span><span class="token string">&quot;&#x6211;&#x7684;&#x90AE;&#x7BB1;&#x662F;&quot;</span><span class="token operator">+</span>email<span class="token operator">+</span><span class="token string">&quot;&#x6211;&#x7684;&#x5DE5;&#x8D44;&#x662F;&quot;</span><span class="token operator">+</span>salary<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>         
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E4%B8%80-%E5%8D%A0%E4%BD%8D%E7%AC%A6%E7%9A%84%E4%BD%BF%E7%94%A8">&#x5341;&#x4E00;&#x3001;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x4F7F;&#x7528;</h5>

<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string name <span class="token operator">=</span> <span class="token string">&quot;&#x5361;&#x5361;&#x897F;&quot;</span><span class="token punctuation">;</span>
    int age <span class="token operator">=</span> <span class="token number">30</span><span class="token punctuation">;</span>
    string email <span class="token operator">=</span> <span class="token string">&quot;kakaxi@qq.com&quot;</span><span class="token punctuation">;</span>
    string adress <span class="token operator">=</span> <span class="token string">&quot;&#x706B;&#x5F71;&#x6751;&quot;</span><span class="token punctuation">;</span>
    decimal salary <span class="token operator">=</span> <span class="token number">5000</span>m<span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6211;&#x53EB;{0}&#x6211;&#x4F4F;&#x5728;{1}&#x6211;&#x4ECA;&#x5E74;{2}&#x5C81;&#x4E86;&#x6211;&#x7684;&#x90AE;&#x7BB1;&#x662F;{3}&#x6211;&#x7684;&#x5DE5;&#x8D44;&#x662F;{4}&quot;</span><span class="token punctuation">,</span>name<span class="token punctuation">,</span> adress<span class="token punctuation">,</span>age<span class="token punctuation">,</span> email<span class="token punctuation">,</span>salary<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E4%BA%8C-%E5%88%9B%E5%BB%BA%E5%86%85%E6%8F%92%E5%AD%97%E7%AC%A6%E4%B8%B2">&#x5341;&#x4E8C;&#x3001;&#x521B;&#x5EFA;&#x5185;&#x63D2;&#x5B57;&#x7B26;&#x4E32;</h5>

<blockquote>
<p><strong>&#x6CE8;&#x610F;:</strong> &#x5B57;&#x7B26;&#x4E32;&#x6587;&#x672C;&#x4EE5; <mark>$</mark> &#x5B57;&#x7B26;&#x5F00;&#x5934;&#xFF0C;&#x540E;&#x63A5;&#x5DE6;&#x53CC;&#x5F15;&#x53F7;&#x5B57;&#x7B26;&#x3002; <mark>$</mark> &#x7B26;&#x53F7;&#x548C;&#x5F15;&#x53F7;&#x5B57;&#x7B26;&#x4E4B;&#x95F4;&#x4E0D;&#x80FD;&#x6709;&#x7A7A;&#x683C;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string name <span class="token operator">=</span> <span class="token string">&quot;&#x5361;&#x5361;&#x897F;&quot;</span><span class="token punctuation">;</span>
    int age <span class="token operator">=</span> <span class="token number">30</span><span class="token punctuation">;</span>
    string email <span class="token operator">=</span> <span class="token string">&quot;kakaxi@qq.com&quot;</span><span class="token punctuation">;</span>
    string adress <span class="token operator">=</span> <span class="token string">&quot;&#x706B;&#x5F71;&#x6751;&quot;</span><span class="token punctuation">;</span>
    decimal salary <span class="token operator">=</span> <span class="token number">5000</span>m<span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>$<span class="token string">&quot;&#x6211;&#x53EB;{name}&#x6211;&#x4F4F;&#x5728;{adress}&#x6211;&#x4ECA;&#x5E74;{age}&#x5C81;&#x4E86;&#x6211;&#x7684;&#x90AE;&#x7BB1;&#x662F;{email}&#x6211;&#x7684;&#x5DE5;&#x8D44;&#x662F;{salary}&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span> &#x6211;&#x53EB;&#x5361;&#x5361;&#x897F;&#x6211;&#x4F4F;&#x5728;&#x706B;&#x5F71;&#x6751;&#x6211;&#x4ECA;&#x5E74;<span class="token number">30</span>&#x5C81;&#x4E86;&#x6211;&#x7684;&#x90AE;&#x7BB1;&#x662F;kakaxi<span class="token variable">@qq</span><span class="token punctuation">.</span>com&#x6211;&#x7684;&#x5DE5;&#x8D44;&#x662F;<span class="token number">5000</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5185;&#x63D2;&#x5B57;&#x7B26;&#x4E32;&#x5728;{}&#x91CC;&#x9762;&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    double a <span class="token operator">=</span> <span class="token number">3</span><span class="token punctuation">;</span>
    double b <span class="token operator">=</span> <span class="token number">4</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>$<span class="token string">&quot;Area of the right triangle with legs of {a} and {b} is {0.5 * a * b}&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span> <span class="token constant">Area</span> of the right triangle with legs of <span class="token number">3</span> <span class="token keyword">and</span> <span class="token number">4</span> is <span class="token number">6</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E4%B8%89-%E4%BA%A4%E6%8D%A2%E5%8F%98%E9%87%8F">&#x5341;&#x4E09;&#x3001;&#x4EA4;&#x6362;&#x53D8;&#x91CF;</h5>

<p>1&#x3001;&#x4F7F;&#x7528;&#x7B2C;&#x4E09;&#x65B9;&#x53D8;&#x91CF;</p>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int a <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    int temp<span class="token punctuation">;</span>
    temp <span class="token operator">=</span> a<span class="token punctuation">;</span>
    a <span class="token operator">=</span> b<span class="token punctuation">;</span>
    b <span class="token operator">=</span> temp<span class="token punctuation">;</span> 
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>$<span class="token string">&quot;a&#x7684;&#x503C;&#x4E3A;{a},b&#x7684;&#x503C;&#x4E3A;{b}&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span> a&#x7684;&#x503C;&#x4E3A;<span class="token number">10</span><span class="token punctuation">,</span>b&#x7684;&#x503C;&#x4E3A;<span class="token number">20</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><p>2&#x3001;&#x4E0D;&#x4F7F;&#x7528;&#x7B2C;&#x4E09;&#x65B9;&#x53D8;&#x91CF;</p>
<blockquote>
<p>&#x9002;&#x7528;&#x4E8E;&#x4EA4;&#x6362;&#x6570;&#x503C;&#x7C7B;&#x578B;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int a <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    a <span class="token operator">=</span> a <span class="token operator">-</span> b<span class="token punctuation">;</span>  
    b <span class="token operator">=</span> a <span class="token operator">+</span> b<span class="token punctuation">;</span>  
    a <span class="token operator">=</span> b <span class="token operator">-</span> a<span class="token punctuation">;</span>  
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>$<span class="token string">&quot;a&#x7684;&#x503C;&#x4E3A;{a},b&#x7684;&#x503C;&#x4E3A;{b}&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span> a&#x7684;&#x503C;&#x4E3A;<span class="token number">10</span><span class="token punctuation">,</span>b&#x7684;&#x503C;&#x4E3A;<span class="token number">20</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E5%9B%9B-%E6%8E%A5%E6%94%B6%E7%94%A8%E6%88%B7%E6%94%B6%E5%85%A5%E7%9A%84%E5%80%BC">&#x5341;&#x56DB;&#x3001;&#x63A5;&#x6536;&#x7528;&#x6237;&#x6536;&#x5165;&#x7684;&#x503C;</h5>

<blockquote>
<p><mark><code>Console.ReadLine();</code></mark> &#x8FD9;&#x53E5;&#x4EE3;&#x7801;&#x7528;&#x4E8E;&#x63A5;&#x6536;&#x7528;&#x6237;&#x7684;&#x8F93;&#x5165;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span> 
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x8F93;&#x5165;&#x60A8;&#x7684;&#x59D3;&#x540D;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    string name <span class="token operator">=</span>  <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x60A8;&#x7684;&#x59D3;&#x540D;&#x662F;&#xFF1A;&quot;</span><span class="token operator">+</span>name<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E4%BA%94-%E8%BD%AC%E4%B9%89%E7%AC%A6%E5%92%8C%E7%AC%A6%E5%8F%B7%E7%9A%84%E4%BD%9C%E7%94%A8">&#x5341;&#x4E94;&#x3001;&#x8F6C;&#x4E49;&#x7B26;&#x548C;@&#x7B26;&#x53F7;&#x7684;&#x4F5C;&#x7528;</h5>

<blockquote>
<p><strong>&#x8F6C;&#x4E49;&#x7B26;</strong> &#x6307;&#x7684;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x2018;\&#x2019;+&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x7684;&#x5B57;&#x7B26;&#xFF0C;&#x7EC4;&#x6210;&#x4E86;&#x4E00;&#x4E2A;&#x5177;&#x6709;&#x7279;&#x6B8A;&#x610F;&#x4E49;&#x7684;&#x5B57;&#x7B26;</p>
</blockquote>
<blockquote>
<ul>
<li><mark>\n</mark>&#xFF1A;&#x8868;&#x793A;&#x6362;&#x884C;</li>
<li><mark>\t</mark>&#xFF1A;&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x5236;&#x8868;&#x7B26;</li>
<li><mark>\</mark>&quot;&#xFF1A;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x82F1;&#x6587;&#x7684;&#x53CC;&#x5F15;&#x53F7;&#x7684;&#x4E00;&#x534A;</li>
<li><mark>\b</mark>&#xFF1A;&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x9000;&#x683C;&#x952E;&#xFF0C;&#x653E;&#x5728;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x4E24;&#x8FB9;&#x6CA1;&#x6709;&#x6548;&#x679C;</li>
<li><mark>\r\n</mark>&#xFF1A;windows&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x4E0D;&#x8BA4;&#x8BC6;\n&#xFF0C;&#x53EA;&#x8BA4;&#x8BC6;\r\n</li>
<li><mark>\\</mark>&#xFF1A;&#x8868;&#x793A;&#x4E00;&#x4E2A;\</li>
</ul>
</blockquote>
<blockquote>
<p><strong>@&#x7B26;&#x53F7;&#x7684;&#x4F5C;&#x7528;</strong>&#xFF1A;</p>
<ul>
<li>&#x53D6;&#x6D88; \ &#x5728;&#x5B57;&#x7B26;&#x4E32;&#x4E2D;&#x7684;&#x8F6C;&#x610F;&#x4F5C;&#x7528;</li>
<li>&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x6309;&#x7167;&#x539F;&#x683C;&#x5F0F;&#x8F93;&#x51FA;</li>
</ul>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string str <span class="token operator">=</span> <span class="token string">&quot;&#x6D3B;&#x5230;&#x8001;&#xFF0C;\r\n&#x5B66;&#x5230;&#x8001;&#x3002;&quot;</span><span class="token punctuation">;</span>
    <span class="token constant">System</span><span class="token punctuation">.</span><span class="token builtin">IO</span><span class="token punctuation">.</span><span class="token builtin">File</span><span class="token punctuation">.</span><span class="token constant">WriteAllText</span><span class="token punctuation">(</span>@<span class="token string">&quot;C:\Users\&#x5C0F;&#x7B11;&#x6B8B;&#x8679;\Desktop\111.txt&quot;</span><span class="token punctuation">,</span> str<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x5199;&#x5165;&#x6210;&#x529F;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p><mark><code>System.IO.File.WriteAllText();</code></mark> &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x6587;&#x4EF6;&#xFF0C;&#x5728;&#x5176;&#x4E2D;&#x5199;&#x5165;&#x6307;&#x5B9A;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x7136;&#x540E;&#x5173;&#x95ED;&#x6587;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x76EE;&#x6807;&#x6587;&#x4EF6;&#x5DF2;&#x5B58;&#x5728;&#xFF0C;&#x5219;&#x8986;&#x76D6;&#x8BE5;&#x6587;&#x4EF6;&#x3002;&#x4E0A;&#x9762;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x7684;&#x4F5C;&#x7528;&#x662F;&#x5728;&#x6307;&#x5B9A;&#x7684;&#x8DEF;&#x5F84;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x5199;&#x5165;&#x6307;&#x5B9A;&#x7684;&#x5185;&#x5BB9;&#xFF0C;&#x5982;&#x4E0B;&#x56FE;&#xFF1A;</p>
</blockquote>
<p><img src="1.png?0.758149953247196" alt></p>
<h5 class="mume-header" id="%E5%8D%81%E5%85%AD-%E7%AE%97%E6%9C%AF%E8%BF%90%E7%AE%97%E7%AC%A6%E5%8F%8A%E7%AE%97%E6%9C%AF%E8%A1%A8%E8%BE%BE%E5%BC%8F">&#x5341;&#x516D;&#x3001;&#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x7B26;&#x53CA;&#x7B97;&#x672F;&#x8868;&#x8FBE;&#x5F0F;</h5>

<blockquote>
<p>&#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x7B26;&#xFF1A;<mark>+</mark> &#x3001;<mark>-</mark> &#x3001;<mark>*</mark> &#x3001;<mark>/</mark> &#x3001;<mark>%</mark><br>
&#x7B97;&#x672F;&#x8868;&#x8FBE;&#x5F0F;&#xFF1A;&#x7531;&#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x7B26;&#x8FDE;&#x63A5;&#x7684;&#x5F0F;&#x5B50;</p>
</blockquote>
<h5 class="mume-header" id="%E5%8D%81%E4%B8%83-%E6%98%BE%E7%A4%BA%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2%E5%92%8C%E9%9A%90%E5%BC%8F%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2">&#x5341;&#x4E03;&#x3001;&#x663E;&#x793A;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x548C;&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</h5>

<blockquote>
<p><strong>&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</strong><br>
&#x6211;&#x4EEC;&#x8981;&#x6C42;&#x7B49;&#x53F7;&#x4E24;&#x8FB9;&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#x7684;&#x64CD;&#x4F5C;&#x6570;&#x7684;&#x7C7B;&#x578B;&#x5FC5;&#x987B;&#x4E00;&#x81F4;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x4E00;&#x81F4;&#xFF0C;&#x6EE1;&#x8DB3;&#x4E0B;&#x5217;&#x6761;&#x4EF6;&#xFF0C;&#x5C06;&#x4F1A;&#x81EA;&#x52A8;&#x53D1;&#x751F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#xFF0C;&#x6211;&#x4EEC;&#x79F0;&#x4E4B;&#x4E3A;&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x3002;<br>
1&#x3001;&#x4E24;&#x79CD;&#x7C7B;&#x578B;&#x517C;&#x5BB9;&#xFF1A;<br>
&#x4F8B;&#x5982;&#xFF1A;<mark>int</mark> &#x548C; <mark>double</mark> &#x517C;&#x5BB9;&#xFF08;&#x90FD;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#xFF09;<br>
2&#x3001;&#x76EE;&#x6807;&#x7C7B;&#x578B;&#x5927;&#x4E8E;&#x6E90;&#x7C7B;&#x578B;&#xFF1A;<br>
&#x4F8B;&#x5982;&#xFF1A;<mark>double</mark> &gt; <mark>int</mark> &#xFF08;&#x5C0F;&#x7684;&#x8F6C;&#x5927;&#x7684;&#xFF09;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int a <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    double b <span class="token operator">=</span> a<span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span>&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p><strong>&#x663E;&#x793A;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</strong><br>
1&#x3001;&#x4E24;&#x79CD;&#x7C7B;&#x578B;&#x517C;&#x5BB9;&#xFF1A;<mark>int</mark> &#x548C; <mark>double</mark><br>
2&#x3001;&#x76EE;&#x6807;&#x7C7B;&#x578B;&#x5C0F;&#x4E8E;&#x6E90;&#x7C7B;&#x578B;&#xFF08;&#x5927;&#x7684;&#x8F6C;&#x5C0F;&#x7684;&#xFF09;double ---&gt; int<br>
&#x8BED;&#x6CD5;&#xFF1A;<br>
&#xFF08;&#x5F85;&#x8F6C;&#x6362;&#x7684;&#x7C7B;&#x578B;&#xFF09;&#x8981;&#x8F6C;&#x6362;&#x7684;&#x503C;&#xFF1A;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    double a <span class="token operator">=</span> <span class="token number">10.03</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token punctuation">(</span>int<span class="token punctuation">)</span>a<span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span>&#x663E;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span> <span class="token number">10</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p><strong>&#x603B;&#x7ED3;</strong>&#xFF1A;<br>
&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#xFF1A;int ---&gt; double<br>
&#x663E;&#x793A;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#xFF1A;double ---&gt; int</p>
</blockquote>
<blockquote>
<p><strong>&#x5BF9;&#x4E8E;&#x8868;&#x8FBE;&#x5F0F;:</strong><br>
&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F;double&#x7C7B;&#x578B;,&#x5219;&#x6574;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x53EF;&#x63D0;&#x5347;&#x4E3A;double&#x7C7B;&#x578B;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int a <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token number">3</span><span class="token punctuation">;</span>
    double c <span class="token operator">=</span> a <span class="token operator">/</span> b<span class="token punctuation">;</span> 
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">3</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x63D0;&#x5347;&#x4E3A; <mark>double</mark> &#x578B;&#xFF0C;&#x6700;&#x7B80;&#x5355;&#x7684;&#x65B9;&#x6CD5;&#x662F; <mark><code>a*1.0</code></mark></p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int a <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token number">3</span><span class="token punctuation">;</span>
    double c <span class="token operator">=</span> a<span class="token operator">*</span><span class="token number">1.0</span> <span class="token operator">/</span> b<span class="token punctuation">;</span> 
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">3.33333333333333</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p><mark><code>Console.WriteLine(&quot;{0:0.00}&quot;, c);</code></mark> &#x5C06;&#x7ED3;&#x679C;&#x4FDD;&#x7559;&#x4E24;&#x4F4D;&#x5C0F;&#x6570;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int a <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token number">3</span><span class="token punctuation">;</span>
    double c <span class="token operator">=</span> a<span class="token operator">*</span><span class="token number">1.0</span> <span class="token operator">/</span> b<span class="token punctuation">;</span> 
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;{0:0.00}&quot;</span><span class="token punctuation">,</span> c<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">3.33</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E5%85%AB-convert%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2">&#x5341;&#x516B;&#x3001;Convert&#x7C7B;&#x578B;&#x8F6C;&#x6362;</h5>

<blockquote>
<p>&#x7C7B;&#x578B;&#x5982;&#x679C;&#x76F8;&#x517C;&#x5BB9;&#x7684;&#x4E24;&#x4E2A;&#x53D8;&#x91CF;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x81EA;&#x52A8;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x6216;&#x8005;&#x5F3A;&#x5236;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x3002;&#x4F46;&#x662F;&#xFF0C;&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x4E0D;&#x517C;&#x5BB9;&#xFF0C;&#x6BD4;&#x5982;&#xFF1A;<mark>string</mark> &#x548C; <mark>int</mark> &#x6216;&#x8005;<mark>string</mark> &#x548C;<mark>double</mark>&#x3002;<br>
&#x8FD9;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x53EB;&#x505A;<mark>Convert</mark> &#x7684;&#x8F6C;&#x6362;&#x5DE5;&#x5382;&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#x3002;<br>
<strong>&#x6CE8;&#x610F;&#xFF1A;</strong> &#x4F7F;&#x7528;<mark>Convert</mark>&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#xFF0C;&#x4E5F;&#x8981;&#x6EE1;&#x8DB3;&#x4E00;&#x4E2A;&#x6761;&#x4EF6;&#xFF1A;<br>
&#x5FC5;&#x987B;&#x662F; <strong>&#x5168;&#x6570;&#x5B57;&#x7684;&#x5B57;&#x7B26;&#x4E32;</strong> &#x624D;&#x53EF;&#x4EE5;&#x3002;&#x50CF; <mark><code>string str = &quot;123abc&quot;;</code></mark> &#x7684;&#x5C31;&#x4E0D;&#x884C;&#x4E86;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string str <span class="token operator">=</span> <span class="token string">&quot;123&quot;</span><span class="token punctuation">;</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x8F6C;&#x6362;&#x6210; int &#x6216;&#x8005; double &#x7C7B;&#x578B;
    double a <span class="token operator">=</span> <span class="token constant">Convert</span><span class="token punctuation">.</span><span class="token constant">ToDouble</span><span class="token punctuation">(</span>str<span class="token punctuation">)</span><span class="token punctuation">;</span>
    int b <span class="token operator">=</span> <span class="token constant">Convert</span><span class="token punctuation">.</span><span class="token constant">ToInt32</span><span class="token punctuation">(</span>str<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">123</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">123</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%8D%81%E4%B9%9D-%E5%8A%A0%E5%8A%A0%E5%87%8F%E5%87%8F">&#x5341;&#x4E5D;&#x3001;&#x52A0;&#x52A0;&#x51CF;&#x51CF;</h5>

<blockquote>
<p><strong>++:</strong> &#x5206;&#x4E3A; <mark>&#x524D;++</mark> &#x548C; <mark>&#x540E;++</mark>&#xFF0C;&#x4E0D;&#x7BA1;&#x662F;&#x524D;++&#x8FD8;&#x662F;&#x540E;++&#xFF0C;&#x6700;&#x7EC8;&#x7684;&#x7ED3;&#x679C;&#x90FD;&#x662F;&#x7ED9;&#x8FD9;&#x4E2A;&#x53D8;&#x91CF;&#x52A0;1&#x3002;<br>
<strong>&#x533A;&#x522B;</strong> &#x8868;&#x73B0;&#x5728;&#x8868;&#x8FBE;&#x5F0F;&#x4E2D;&#xFF0C;&#x5982;&#x679C;&#x662F; <strong>&#x524D;++</strong>&#xFF0C;&#x5219;&#x5148;&#x7ED9;&#x8FD9;&#x4E2A;&#x53D8;&#x91CF;&#x81EA;&#x8EAB;&#x52A0;1&#xFF0C;&#x7136;&#x540E;&#x5E26;&#x7740;&#x8FD9;&#x4E2A;&#x52A0;1&#x540E;&#x7684;&#x503C;&#x53BB;&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#x3002;<br>
&#x5982;&#x679C;&#x662F; <strong>&#x540E;++</strong>&#xFF0C;&#x5219;&#x5148;&#x62FF;&#x539F;&#x503C;&#x53C2;&#x4E0E;&#x8BA1;&#x7B97;&#xFF0C;&#x8FD0;&#x7B97;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x5728;&#x5C06;&#x8FD9;&#x4E2A;&#x53D8;&#x91CF;&#x81EA;&#x8EAB;&#x52A0;1&#x3002;</p>
</blockquote>
<blockquote>
<p><strong>--:</strong> &#x540C;&#x4E0A;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int num1 <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    int result <span class="token operator">=</span> num1 <span class="token operator">+</span> num1<span class="token operator">++</span><span class="token punctuation">;</span>
    int result2 <span class="token operator">=</span> num1 <span class="token operator">+</span> <span class="token operator">++</span>num1<span class="token punctuation">;</span>
    int result3 <span class="token operator">=</span> num1 <span class="token operator">-</span> <span class="token operator">--</span>num1<span class="token punctuation">;</span>
    int result4 <span class="token operator">=</span> num1 <span class="token operator">-</span> num1<span class="token operator">--</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token operator">/</span><span class="token operator">/</span><span class="token number">20</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>result2<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span><span class="token number">23</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>result3<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span><span class="token number">1</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>result4<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span><span class="token number">0</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x5BF9;&#x4E8E;&#x50CF;&#x52A0;&#x52A0;&#x6216;&#x8005;&#x51CF;&#x51CF;&#x8FD9;&#x6837;&#x53EA;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x5C31;&#x53EF;&#x4EE5;&#x5B8C;&#x6210;&#x7684;&#x8FD0;&#x7B97;&#xFF0C;&#x6211;&#x4EEC;&#x79F0;&#x4E4B;&#x4E3A; <strong>&#x4E00;&#x5143;&#x8FD0;&#x7B97;&#x7B26;</strong>&#x3002;<br>
+&#xFF0C;-&#xFF0C;*&#xFF0C;/&#xFF0C;%&#xFF0C;&#x5BF9;&#x4E8E;&#x8FD9;&#x4E9B;&#x9700;&#x8981;&#x4E24;&#x4E2A;&#x6216;&#x4EE5;&#x4E0A;&#x624D;&#x80FD;&#x5B8C;&#x6210;&#x8FD0;&#x7B97;&#x7684;&#x64CD;&#x4F5C;&#x7B26;&#xFF0C;&#x6211;&#x4EEC;&#x79F0;&#x4E4B;&#x4E3A; <strong>&#x4E8C;&#x5143;&#x8FD0;&#x7B97;&#x7B26;</strong>&#x3002;<br>
<strong>&#x4E00;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#x7684;&#x4F18;&#x5148;&#x7EA7;&#x8981;&#x9AD8;&#x4E8E;&#x4E8C;&#x5143;&#x8FD0;&#x7B97;&#x7B26;</strong>&#x3002;&#x5982;&#x679C;&#x5728;&#x4E00;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x5F53;&#x4E2D;&#xFF0C;&#x65E2;&#x6709;&#x4E00;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#x53C8;&#x6709;&#x4E8C;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#xFF0C;&#x6211;&#x4EEC;&#x9996;&#x5148;&#x8BA1;&#x7B97;&#x4E00;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#x3002;</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81-%E5%85%B3%E7%B3%BB%E8%BF%90%E7%AE%97%E7%AC%A66%E4%B8%AA">&#x4E8C;&#x5341;&#x3001;&#x5173;&#x7CFB;&#x8FD0;&#x7B97;&#x7B26;(6&#x4E2A;)</h5>

<blockquote>
<p><strong>&gt;</strong>&#x3001;<strong>&lt;</strong>&#x3001;<strong>==</strong>&#x3001;<strong>&gt;=</strong>&#x3001;<strong>&lt;=</strong>&#x3001;<strong>!=</strong><br>
&#x5173;&#x7CFB;&#x8FD0;&#x7B97;&#x7B26;&#x662F;&#x7528;&#x6765;&#x63CF;&#x8FF0;&#x4E24;&#x4E2A;&#x4E8B;&#x7269;&#x4E4B;&#x95F4;&#x7684;&#x5173;&#x7CFB;&#x3002;</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E4%B8%80-%E9%80%BB%E8%BE%91%E8%BF%90%E7%AE%97%E7%AC%A63%E4%B8%AA">&#x4E8C;&#x5341;&#x4E00;&#x3001;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;(3&#x4E2A;)</h5>

<blockquote>
<p><mark>&amp;&amp;</mark>(&#x903B;&#x8F91;&#x4E0E;)&#x3001;<mark>||</mark>(&#x903B;&#x8F91;&#x6216;)&#x3001;<mark>!</mark>(&#x903B;&#x8F91;&#x975E;)<br>
<strong>&#x903B;&#x8F91;&#x4E0E;&#x7684;&#x4F18;&#x5148;&#x7EA7;&#x8981;&#x9AD8;&#x4E8E;&#x903B;&#x8F91;&#x6216;</strong></p>
</blockquote>
<blockquote>
<p><strong>&#x903B;&#x8F91;&#x4E0E;(&amp;&amp;):</strong></p>
</blockquote>
<table>
<thead>
<tr>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E00;</th>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E8C;</th>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E00; <mark>&amp;&amp;</mark> &#x8868;&#x8FBE;&#x5F0F;&#x4E8C;</th>
</tr>
</thead>
<tbody>
<tr>
<td>true</td>
<td>true</td>
<td>true</td>
</tr>
<tr>
<td>false</td>
<td>true</td>
<td>false</td>
</tr>
<tr>
<td>true</td>
<td>false</td>
<td>false</td>
</tr>
<tr>
<td>false</td>
<td>false</td>
<td>false</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>&#x903B;&#x8F91;&#x6216;(||):</strong></p>
</blockquote>
<table>
<thead>
<tr>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E00;</th>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E8C;</th>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E00; <mark>||</mark> &#x8868;&#x8FBE;&#x5F0F;&#x4E8C;</th>
</tr>
</thead>
<tbody>
<tr>
<td>true</td>
<td>true</td>
<td>true</td>
</tr>
<tr>
<td>false</td>
<td>true</td>
<td>true</td>
</tr>
<tr>
<td>true</td>
<td>false</td>
<td>true</td>
</tr>
<tr>
<td>false</td>
<td>false</td>
<td>false</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>&#x903B;&#x8F91;&#x975E;(!)&#xFF1A;</strong></p>
</blockquote>
<table>
<thead>
<tr>
<th>&#x8868;&#x8FBE;&#x5F0F;&#x4E00;</th>
<th><mark>!</mark> &#x8868;&#x8FBE;&#x5F0F;&#x4E00;</th>
</tr>
</thead>
<tbody>
<tr>
<td>true</td>
<td>false</td>
</tr>
<tr>
<td>false</td>
<td>true</td>
</tr>
</tbody>
</table>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E4%BA%8C-%E5%A4%8D%E5%90%88%E8%B5%8B%E5%80%BC%E8%BF%90%E7%AE%97%E7%AC%A65%E4%B8%AA">&#x4E8C;&#x5341;&#x4E8C;&#x3001;&#x590D;&#x5408;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;(5&#x4E2A;)</h5>

<blockquote>
<p><strong>+=</strong>&#x3001;<strong>-=</strong>&#x3001;<strong>*=</strong>&#x3001;<strong>/=</strong>&#x3001;<strong>%=</strong></p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E4%B8%89-%E7%A8%8B%E5%BA%8F%E7%BB%93%E6%9E%84">&#x4E8C;&#x5341;&#x4E09;&#x3001;&#x7A0B;&#x5E8F;&#x7ED3;&#x6784;</h5>

<blockquote>
<p><strong>1&#x3001;&#x987A;&#x5E8F;&#x7ED3;&#x6784;&#xFF1A;</strong> &#x7A0B;&#x5E8F;&#x4ECE;Main&#x51FD;&#x6570;&#x8FDB;&#x5165;&#xFF0C;&#x4ECE;&#x4E0A;&#x5230;&#x4E0B;&#x4E00;&#x884C;&#x4E00;&#x884C;&#x5730;&#x6267;&#x884C;&#xFF0C;&#x4E0D;&#x4F1A;&#x843D;&#x4E0B;&#x4EFB;&#x4F55;&#x4E00;&#x884C;&#x3002;<br>
<strong>2&#x3001;&#x5206;&#x652F;&#x7ED3;&#x6784;&#xFF1A;</strong> if&#x3001;if-else<br>
<strong>3&#x3001;&#x9009;&#x62E9;&#x7ED3;&#x6784;&#xFF1A;</strong> if&#x3001;else-if&#x3001;switch-case<br>
<strong>4&#x3001;&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#xFF1A;</strong> while&#x3001;do-while&#x3001;for&#x3001;foreach</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E5%9B%9B-if%E8%AF%AD%E5%8F%A5">&#x4E8C;&#x5341;&#x56DB;&#x3001;if&#x8BED;&#x53E5;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
if(&#x5224;&#x65AD;&#x6761;&#x4EF6;){<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x8BED;&#x53E5;;<br>
}</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E4%BA%94-if-else%E8%AF%AD%E5%8F%A5">&#x4E8C;&#x5341;&#x4E94;&#x3001;if-else&#x8BED;&#x53E5;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
if(&#x5224;&#x65AD;&#x6761;&#x4EF6;){<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x8BED;&#x53E5;&#x4E00;;<br>
}else{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x8BED;&#x53E5;&#x4E8C;;<br>
}</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E5%85%AD-%E5%BC%82%E5%B8%B8%E6%8D%95%E8%8E%B7">&#x4E8C;&#x5341;&#x516D;&#x3001;&#x5F02;&#x5E38;&#x6355;&#x83B7;</h5>

<blockquote>
<p>&#x6211;&#x4EEC;&#x5728;&#x7A0B;&#x5E8F;&#x4E2D;&#x7ECF;&#x5E38;&#x4F1A;&#x51FA;&#x73B0;&#x5404;&#x79CD;&#x5404;&#x6837;&#x7684;&#x5F02;&#x5E38;&#xFF0C;&#x4F60;&#x5982;&#x679C;&#x60F3;&#x8981;&#x4F60;&#x7684;&#x7A0B;&#x5E8F;&#x53D8;&#x5F97;&#x575A;&#x5F3A;&#x4E00;&#x4E9B;&#xFF0C;&#x5728;&#x4F60;&#x7684;&#x4EE3;&#x7801;&#x4E2D;&#x5E94;&#x8BE5;&#x7ECF;&#x5E38;&#x6027;&#x7684;&#x4F7F;&#x7528;<mark>try-catch</mark>&#x6765;&#x8FDB;&#x884C;&#x5F02;&#x5E38;&#x6355;&#x83B7;&#x3002;<br>
&#x90A3;&#x884C;&#x4EE3;&#x7801;&#x6709;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#xFF0C;&#x4F60;&#x5C31;&#x8E39;&#x4ED6;&#x4E00;&#x811A;&#x3002;<br>
<strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
try<br>
{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x53EF;&#x80FD;&#x4F1A;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x7684;&#x4EE3;&#x7801;;<br>
}<br>
catch<br>
{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x540E;&#x8981;&#x6267;&#x884C;&#x7684;&#x4EE3;&#x7801;;<br>
}<br>
try&#x548C;catch&#x4E4B;&#x95F4;&#x4E0D;&#x80FD;&#x6709;&#x5176;&#x4ED6;&#x7684;&#x4EE3;&#x7801;</p>
</blockquote>
<blockquote>
<p>&#x6267;&#x884C;&#x8FC7;&#x7A0B;&#xFF1A;&#x5982;&#x679C;try&#x4E2D;&#x7684;&#x4EE3;&#x7801;&#x6CA1;&#x6709;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#xFF0C;&#x90A3;&#x4E48;catch&#x4E2D;&#x7684;&#x4EE3;&#x7801;&#x4E0D;&#x4F1A;&#x6267;&#x884C;&#x3002;&#x5982;&#x679C;try&#x4E2D;&#x7684;&#x4EE3;&#x7801;&#x51FA;&#x73B0;&#x4E86;&#x5F02;&#x5E38;&#xFF0C;&#x90A3;&#x6015;&#x8FD9;&#x884C;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x7684;&#x4EE3;&#x7801;&#x540E;&#x9762;&#x8FD8;&#x6709;&#x4E00;&#x767E;&#x884C;&#x4EE3;&#x7801;&#x90FD;&#x4E0D;&#x4F1A;&#x6267;&#x884C;&#x4E86;&#xFF0C;&#x800C;&#x662F;&#x76F4;&#x63A5;&#x8DF3;&#x5230;catch&#x4E2D;&#x6267;&#x884C;&#x4EE3;&#x7801;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int num <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x8F93;&#x5165;&#x4E00;&#x4E2A;&#x6570;&#x5B57;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    try
    <span class="token punctuation">{</span>
        num <span class="token operator">=</span> <span class="token constant">Convert</span><span class="token punctuation">.</span><span class="token constant">ToInt32</span><span class="token punctuation">(</span><span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    catch
    <span class="token punctuation">{</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;&#x4E0D;&#x80FD;&#x8F6C;&#x6362;&#x6210;&#x6570;&#x5B57;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>num<span class="token operator">*</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">;</span> 
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E4%B8%83-switch-case%E8%AF%AD%E5%8F%A5">&#x4E8C;&#x5341;&#x4E03;&#x3001;switch-case&#x8BED;&#x53E5;</h5>

<blockquote>
<p>&#x7528;&#x6765;&#x5904;&#x7406;&#x591A;&#x6761;&#x4EF6;&#x7684;&#x5B9A;&#x503C;&#x7684;&#x5224;&#x65AD;<br>
<strong>&#x8BED;&#x6CD5;:</strong><br>
switch(&#x53D8;&#x91CF;&#x6216;&#x8005;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x503C;){<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;case  &#x503C;1:&#x8981;&#x6267;&#x884C;&#x7684;&#x4EE3;&#x7801;;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;break;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;case  &#x503C;2:&#x8981;&#x6267;&#x884C;&#x7684;&#x4EE3;&#x7801;;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;break;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;case  &#x503C;3:&#x8981;&#x6267;&#x884C;&#x7684;&#x4EE3;&#x7801;;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;break;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;......<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;default:&#x8981;&#x6267;&#x884C;&#x7684;&#x4EE3;&#x7801;;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;break;<br>
}</p>
</blockquote>
<h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E5%85%AB-%E5%BE%AA%E7%8E%AF%E7%BB%93%E6%9E%84-while%E5%BE%AA%E7%8E%AF">&#x4E8C;&#x5341;&#x516B;&#x3001;&#x5FAA;&#x73AF;&#x7ED3;&#x6784;   while&#x5FAA;&#x73AF;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
while(&#x5FAA;&#x73AF;&#x6761;&#x4EF6;){<br>
&#x5FAA;&#x73AF;&#x4F53;;<br>
}</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    <span class="token keyword">while</span> <span class="token punctuation">(</span>i<span class="token operator">&lt;</span><span class="token number">100</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x8F93;&#x5165;&#x4E00;&#x4E2A;&#x6570;&#x5B57;\t{0}&quot;</span><span class="token punctuation">,</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
        i<span class="token operator">++</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%BA%8C%E5%8D%81%E4%B9%9D-break%E7%9A%84%E7%94%A8%E6%B3%95">&#x4E8C;&#x5341;&#x4E5D;&#x3001;break&#x7684;&#x7528;&#x6CD5;</h5>

<blockquote>
<p><mark>break</mark>&#x7684;&#x4F5C;&#x7528;&#xFF1A;<br>
1&#x3001;&#x8DF3;&#x51FA;switch-case&#x7ED3;&#x6784;<br>
2&#x3001;&#x53EF;&#x4EE5;&#x8DF3;&#x51FA;&#x5F53;&#x524D;&#x5FAA;&#x73AF;<br>
break&#x4E00;&#x822C;&#x4E0D;&#x5355;&#x72EC;&#x4F7F;&#x7528;&#xFF0C;&#x800C;&#x662F;&#x8DDF;&#x7740;if&#x5224;&#x65AD;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#xFF0C;&#x8868;&#x793A;&#x5F53;&#x6EE1;&#x8DB3;&#x67D0;&#x4E9B;&#x6761;&#x4EF6;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5C31;&#x4E0D;&#x518D;&#x5FAA;&#x73AF;&#x4E86;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int i <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
    int j <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
    <span class="token keyword">while</span> <span class="token punctuation">(</span>i<span class="token operator">&lt;</span><span class="token number">100</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token keyword">while</span> <span class="token punctuation">(</span>j<span class="token operator">&lt;=</span><span class="token number">10</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6211;&#x662F;while&#x91CC;&#x9762;&#x7684;&#x5FAA;&#x73AF;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            j<span class="token operator">++</span><span class="token punctuation">;</span>
            <span class="token keyword">break</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>   
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6211;&#x662F;while&#x5916;&#x5C42;&#x5FAA;&#x73AF;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        i<span class="token operator">++</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%89%E5%8D%81-do-while%E5%BE%AA%E7%8E%AF">&#x4E09;&#x5341;&#x3001;do-while&#x5FAA;&#x73AF;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
do<br>
{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#x5FAA;&#x73AF;&#x4F53;;<br>
}while(&#x5FAA;&#x73AF;&#x6761;&#x4EF6;);</p>
</blockquote>
<h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E4%B8%80-%E7%A8%8B%E5%BA%8F%E8%B0%83%E8%AF%95">&#x4E09;&#x5341;&#x4E00;&#x3001;&#x7A0B;&#x5E8F;&#x8C03;&#x8BD5;</h5>

<blockquote>
<ul>
<li>&#x8BBE;&#x7F6E;&#x65AD;&#x70B9;&#xFF08;&#x5728;&#x884C;&#x53F7;&#x524D;&#x70B9;&#x51FB;&#x7A7A;&#x767D;&#x5904;&#xFF09;</li>
<li>&#x5355;&#x6B65;&#x8FD0;&#x884C;&#xFF08;F11&#x9010;&#x8BED;&#x53E5;&#x8C03;&#x8BD5;&#xFF09;</li>
<li>&#x89C2;&#x5BDF;&#x53D8;&#x91CF;&#xFF08;&#x9F20;&#x6807;&#x653E;&#x5728;&#x53D8;&#x91CF;&#x540D;&#x4E0A;&#x89C2;&#x5BDF;&#xFF09;</li>
<li>F10&#x9010;&#x8FC7;&#x7A0B;&#x8C03;&#x8BD5;</li>
</ul>
</blockquote>
<h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E4%BA%8C-for%E5%BE%AA%E7%8E%AF">&#x4E09;&#x5341;&#x4E8C;&#x3001;for&#x5FAA;&#x73AF;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
for(&#x8868;&#x8FBE;&#x5F0F;1,&#x8868;&#x8FBE;&#x5F0F;2,&#x8868;&#x8FBE;&#x5F0F;3)<br>
{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x5FAA;&#x73AF;&#x4F53;;<br>
}<br>
&#x5C0F;&#x6280;&#x5DE7;&#xFF1A;&#x8F93;&#x5165;for&#x5173;&#x952E;&#x5B57;&#x540E;&#x53CC;&#x51FB;Tab&#x952E;&#x5373;&#x53EF;&#x81EA;&#x52A8;&#x8865;&#x5168;&#x4EE3;&#x7801;&#x3002;<br>
&#x8F93;&#x5165;forr&#xFF0C;&#x53CC;&#x51FB;Tab&#x952E;&#x5C06;&#x81EA;&#x52A8;&#x8865;&#x5168;&#x9006;&#x5411;for&#x5FAA;&#x73AF;&#x4EE3;&#x7801;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">10</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x5C0F;&#x7B11;&#x6B8B;&#x8679;{0}&quot;</span><span class="token punctuation">,</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x6B63;&#x5411;for&#x5FAA;&#x73AF; &#x548C; &#x9006;&#x5411;for&#x5FAA;&#x73AF;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x6B63;&#x5411;<span class="token keyword">for</span>&#x5FAA;&#x73AF;
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i1 <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i1 <span class="token operator">&lt;</span> <span class="token number">10</span><span class="token punctuation">;</span> i1<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6B63;&#x5411;&#x5FAA;&#x73AF;{0}&quot;</span><span class="token punctuation">,</span>i1<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x9006;&#x5411;<span class="token keyword">for</span>&#x5FAA;&#x73AF;
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i2 <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span> i2 <span class="token operator">&gt;=</span> <span class="token number">1</span><span class="token punctuation">;</span> i2<span class="token operator">--</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x9006;&#x5411;&#x5FAA;&#x73AF;{0}&quot;</span><span class="token punctuation">,</span>i2<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><p><img src="2.png?0.6436717428884979" alt></p>
<blockquote>
<p>&#x53CC;&#x5C42;for&#x5FAA;&#x73AF;&#x8F93;&#x51FA;&#x4E58;&#x6CD5;&#x53E3;&#x8BC0;&#x8868;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> <span class="token number">9</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span>int j <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span> j <span class="token operator">&lt;=</span> i<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">Write</span><span class="token punctuation">(</span><span class="token string">&quot;{0}*{1}={2}\t&quot;</span><span class="token punctuation">,</span>j<span class="token punctuation">,</span>i<span class="token punctuation">,</span>i<span class="token operator">*</span>j<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token operator">/</span><span class="token operator">/</span>&#x4E00;&#x884C;&#x663E;&#x793A;&#x4E0D;&#x6362;&#x884C;
        <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token operator">/</span><span class="token operator">/</span>&#x6362;&#x884C;
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><p><img src="3.png?0.09309237497907907" alt></p>
<h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E4%B8%89-intparse">&#x4E09;&#x5341;&#x4E09;&#x3001;int.Parse</h5>

<blockquote>
<p>int.Parse()&#x548C;Convert.ToInt32()&#x7528;&#x6CD5;&#x4E00;&#x6837;&#xFF0C;&#x5B9E;&#x8D28;&#x4E0A;Convert.ToInt32()&#x8C03;&#x7684;&#x4E5F;&#x662F;int.Parse()&#x65B9;&#x6CD5;&#x3002;</p>
</blockquote>
<blockquote>
<p>int.tryParse();</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby" class="language-ruby">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int num <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    bool b <span class="token operator">=</span> int<span class="token punctuation">.</span><span class="token constant">TryParse</span><span class="token punctuation">(</span><span class="token string">&quot;123&quot;</span><span class="token punctuation">,</span> out num<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span> <span class="token keyword">true</span> <span class="token number">123</span>
</pre><pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int num <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    bool b <span class="token operator">=</span> int<span class="token punctuation">.</span><span class="token constant">TryParse</span><span class="token punctuation">(</span><span class="token string">&quot;123abc&quot;</span><span class="token punctuation">,</span> out num<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token keyword">false</span> <span class="token number">0</span>
<span class="token operator">/</span><span class="token operator">/</span>int<span class="token punctuation">.</span><span class="token constant">TryParse</span><span class="token punctuation">(</span><span class="token punctuation">)</span>&#x5C1D;&#x8BD5;&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#xFF0C;&#x8F6C;&#x6362;&#x5931;&#x8D25;&#xFF0C;&#x4E0D;&#x4F1A;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#x3002;
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E5%9B%9B-continue">&#x4E09;&#x5341;&#x56DB;&#x3001;Continue</h5>

<blockquote>
<p>&#x7ACB;&#x5373;&#x7ED3;&#x675F;&#x672C;&#x6B21;&#x5FAA;&#x73AF;&#xFF0C;&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x6210;&#x7ACB;&#xFF0C;&#x5219;&#x8FDB;&#x5165;&#x4E0B;&#x4E00;&#x6B21;&#x5FAA;&#x73AF;&#xFF0C;&#x5426;&#x5219;&#x9000;&#x51FA;&#x5FAA;&#x73AF;&#x3002;</p>
</blockquote>
<h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E4%BA%94-%E4%B8%89%E5%85%83%E8%A1%A8%E8%BE%BE%E5%BC%8F">&#x4E09;&#x5341;&#x4E94;&#x3001;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;:</strong><br>
&#x8868;&#x8FBE;&#x5F0F;1?&#x8868;&#x8FBE;&#x5F0F;2:&#x8868;&#x8FBE;&#x5F0F;3</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int num <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    int num2 <span class="token operator">=</span> <span class="token number">2</span><span class="token punctuation">;</span>
    int max <span class="token operator">=</span> num <span class="token operator">&gt;</span> num2 <span class="token operator">?</span> num <span class="token punctuation">:</span> num2<span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>max<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">2</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E5%85%AD-%E9%9A%8F%E6%9C%BA%E6%95%B0">&#x4E09;&#x5341;&#x516D;&#x3001;&#x968F;&#x673A;&#x6570;</h5>

<blockquote>
<p><strong>&#x4EA7;&#x751F;&#x968F;&#x673A;&#x6570;</strong><br>
1&#x3001;&#x521B;&#x5EFA;&#x80FD;&#x591F;&#x4EA7;&#x751F;&#x968F;&#x673A;&#x6570;&#x7684;&#x5BF9;&#x8C61;<br>
<mark><code>Random r = new Random();</code></mark><br>
2&#x3001;&#x8BA9;&#x4EA7;&#x751F;&#x968F;&#x673A;&#x6570;&#x7684;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x8C03;&#x7528;&#x65B9;&#x6CD5;&#x6765;&#x4EA7;&#x751F;&#x968F;&#x673A;&#x6570;&#xFF08;<mark>&#x5DE6;&#x95ED;&#x53F3;&#x5F00;&#x533A;&#x95F4;</mark>&#xFF09;<br>
<mark><code>int rNumber = r.Next(1, 10);</code></mark></p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token constant">Random</span> r <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Random</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    int rNumber <span class="token operator">=</span> r<span class="token punctuation">.</span><span class="token constant">Next</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>rNumber<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span>&#x751F;&#x6210;<span class="token number">1</span><span class="token operator">~</span><span class="token number">10</span>&#x7684;&#x968F;&#x673A;&#x6570;
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E4%B8%83-%E5%B8%B8%E9%87%8F">&#x4E09;&#x5341;&#x4E03;&#x3001;&#x5E38;&#x91CF;</h5>

<blockquote>
<p><strong>&#x58F0;&#x660E;&#x5E38;&#x91CF;&#x7684;&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
<mark>const</mark> &#x53D8;&#x91CF;&#x7C7B;&#x578B; &#x53D8;&#x91CF;&#x540D; = &#x503C;;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int number <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    number <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span>&#x4F53;&#x73B0;&#x4E86;&#x53D8;&#x91CF;&#x53EF;&#x4EE5;&#x88AB;&#x91CD;&#x65B0;&#x8D4B;&#x503C;
    const int num <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span>&#x5E38;&#x91CF;&#x4E0D;&#x80FD;&#x591F;&#x88AB;&#x91CD;&#x65B0;&#x8D4B;&#x503C;
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E5%85%AB-%E6%9E%9A%E4%B8%BE">&#x4E09;&#x5341;&#x516B;&#x3001;&#x679A;&#x4E3E;</h5>

<blockquote>
<p><strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
[public] enum &#x679A;&#x4E3E;&#x540D;<br>
{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x503C;1,<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x503C;2,<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x503C;3<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;......<br>
}</p>
</blockquote>
<blockquote>
<p><mark>public</mark>&#xFF1A;&#x8BBF;&#x95EE;&#x4FEE;&#x9970;&#x7B26;&#xFF0C;&#x516C;&#x5F00;&#x7684;&#x516C;&#x5171;&#x7684;&#xFF0C;&#x54EA;&#x90FD;&#x80FD;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x3002;<br>
<mark>enum</mark>&#xFF1A;&#x5173;&#x952E;&#x5B57;&#xFF0C;&#x58F0;&#x660E;&#x679A;&#x4E3E;&#x7684;&#x5173;&#x952E;&#x5B57;&#x3002;<br>
<mark>&#x679A;&#x4E3E;&#x540D;</mark>&#xFF1A;&#x8981;&#x7B26;&#x5408;Pascal&#x547D;&#x540D;&#x89C4;&#x8303;&#x3002;<br>
&#x5C06;&#x679A;&#x4E3E;&#x58F0;&#x660E;&#x5230;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x7684;&#x4E0B;&#x9762;&#xFF0C;&#x7C7B;&#x7684;&#x5916;&#x9762;&#xFF0C;&#x8868;&#x793A;&#x8FD9;&#x4E2A;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4E0B;&#xFF0C;&#x6240;&#x6709;&#x7684;&#x7C7B;&#x90FD;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x679A;&#x4E3E;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">namespace _02_secondDemo
<span class="token punctuation">{</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x58F0;&#x660E;&#x4E86;&#x4E00;&#x4E2A;&#x679A;&#x4E3E;  <span class="token constant">Gender</span>
    <span class="token keyword">public</span> enum <span class="token constant">Gender</span>
    <span class="token punctuation">{</span>
        &#x7537;<span class="token punctuation">,</span>
        &#x5973;
    <span class="token punctuation">}</span>
    <span class="token keyword">class</span> <span class="token class-name">Program</span>
    <span class="token punctuation">{</span>
        static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            int number <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
            <span class="token operator">/</span><span class="token operator">/</span>&#x4F7F;&#x7528;&#x679A;&#x4E3E;
            <span class="token constant">Gender</span> gender <span class="token operator">=</span> <span class="token constant">Gender</span><span class="token punctuation">.</span>&#x7537;<span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>gender<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E4%B8%89%E5%8D%81%E4%B9%9D-%E6%9E%9A%E4%B8%BE%E7%B1%BB%E5%9E%8B%E5%92%8Cstring%E4%BB%A5%E5%8F%8Aint%E4%B9%8B%E9%97%B4%E7%9A%84%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2">&#x4E09;&#x5341;&#x4E5D;&#x3001;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x548C;string&#x4EE5;&#x53CA;int&#x4E4B;&#x95F4;&#x7684;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</h5>

<blockquote>
<p>&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x9ED8;&#x8BA4;&#x53EF;&#x4EE5;&#x8DDF;int&#x7C7B;&#x578B;&#x4E92;&#x76F8;&#x8F6C;&#x6362;&#xFF0C;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x8DDF;int&#x7C7B;&#x578B;&#x662F;&#x517C;&#x5BB9;&#x7684;</p>
</blockquote>
<blockquote>
<p>&#x5C06;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x5F3A;&#x5236;&#x8F6C;&#x6362;&#x4E3A;int&#x7C7B;&#x578B;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">namespace _02_secondDemo
<span class="token punctuation">{</span> 
    <span class="token keyword">public</span> enum <span class="token constant">QQState</span>
    <span class="token punctuation">{</span>
        <span class="token constant">OnLine</span><span class="token operator">=</span><span class="token number">2</span><span class="token punctuation">,</span>
        <span class="token constant">OffLine</span><span class="token punctuation">,</span>
        <span class="token constant">Leave</span><span class="token operator">=</span><span class="token number">5</span><span class="token punctuation">,</span>
        <span class="token constant">Busy</span><span class="token punctuation">,</span>
        <span class="token constant">QMe</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">class</span> <span class="token class-name">Program</span>
    <span class="token punctuation">{</span>
        static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token constant">QQState</span> state <span class="token operator">=</span> <span class="token constant">QQState</span><span class="token punctuation">.</span><span class="token constant">OnLine</span><span class="token punctuation">;</span>
            int n <span class="token operator">=</span> <span class="token punctuation">(</span>int<span class="token punctuation">)</span>state<span class="token punctuation">;</span>
            <span class="token operator">/</span><span class="token operator">/</span>&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x9ED8;&#x8BA4;&#x53EF;&#x4EE5;&#x8DDF;int&#x7C7B;&#x578B;&#x4E92;&#x76F8;&#x8F6C;&#x6362;&#xFF0C;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x8DDF;int&#x7C7B;&#x578B;&#x662F;&#x517C;&#x5BB9;&#x7684;
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token punctuation">(</span>int<span class="token punctuation">)</span><span class="token constant">QQState</span><span class="token punctuation">.</span><span class="token constant">OffLine</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token punctuation">(</span>int<span class="token punctuation">)</span><span class="token constant">QQState</span><span class="token punctuation">.</span><span class="token constant">Leave</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token punctuation">(</span>int<span class="token punctuation">)</span><span class="token constant">QQState</span><span class="token punctuation">.</span><span class="token constant">Busy</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token punctuation">(</span>int<span class="token punctuation">)</span><span class="token constant">QQState</span><span class="token punctuation">.</span><span class="token constant">QMe</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">23567</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x5C06;int&#x7C7B;&#x578B;&#x5F3A;&#x5236;&#x8F6C;&#x6362;&#x4E3A;&#x679A;&#x4E3E;&#x7C7B;&#x578B;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token comment">#region  &#x5C06;int&#x7C7B;&#x578B;&#x5F3A;&#x5236;&#x8F6C;&#x6362;&#x4E3A;&#x679A;&#x4E3E;&#x7C7B;&#x578B;</span>
    int n1 <span class="token operator">=</span> <span class="token number">3</span><span class="token punctuation">;</span>
    <span class="token constant">QQState</span> state <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span>n1<span class="token punctuation">;</span>
    int n2 <span class="token operator">=</span> <span class="token number">8</span><span class="token punctuation">;</span>
    <span class="token constant">QQState</span> state2 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span>n2<span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>state<span class="token punctuation">)</span><span class="token punctuation">;</span>   <span class="token operator">/</span><span class="token operator">/</span><span class="token constant">Busy</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>state2<span class="token punctuation">)</span><span class="token punctuation">;</span>   <span class="token operator">/</span><span class="token operator">/</span><span class="token number">8</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment">#endregion</span>
 <span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x5C06;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x6210;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x6240;&#x7528;&#x7684;&#x7C7B;&#x578B;&#x90FD;&#x80FD;&#x8F6C;&#x6362;&#x6210;string&#x7C7B;&#x578B;
    <span class="token constant">QQState</span> state <span class="token operator">=</span> <span class="token constant">QQState</span><span class="token punctuation">.</span><span class="token constant">OnLine</span><span class="token punctuation">;</span>
    string str <span class="token operator">=</span> state<span class="token punctuation">.</span><span class="token constant">ToString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>str<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token constant">OnLine</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x5C06;string&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#x4E3A;&#x679A;&#x4E3E;&#x7C7B;&#x578B;</p>
</blockquote>
<blockquote>
<ul>
<li>&#x5982;&#x679C;&#x8F6C;&#x6362;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#x6570;&#x5B57;&#xFF0C;&#x5219;&#x5C31;&#x7B97;&#x679A;&#x4E3E;&#x4E2D;&#x6CA1;&#x6709;&#xFF0C;&#x4E5F;&#x4E0D;&#x4F1A;&#x62A5;&#x5F02;&#x5E38;</li>
<li>&#x5F53;&#x8F6C;&#x6362;&#x7684;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#x6587;&#x672C;&#xFF0C;&#x5982;&#x679C;&#x679A;&#x4E3E;&#x4E2D;&#x6CA1;&#x6709;&#xFF0C;&#x5219;&#x4F1A;&#x629B;&#x5F02;&#x5E38;&#x3002;</li>
</ul>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string s <span class="token operator">=</span> <span class="token string">&quot;0&quot;</span><span class="token punctuation">;</span>
    <span class="token constant">QQState</span> state <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token constant">Enum</span><span class="token punctuation">.</span><span class="token constant">Parse</span><span class="token punctuation">(</span>typeof<span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token punctuation">,</span> s<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>state<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token constant">OnLine</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x4E00;&#x4E2A;&#x7EC3;&#x4E60;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">namespace _02_secondDemo
<span class="token punctuation">{</span>
    <span class="token keyword">public</span> enum <span class="token constant">QQState</span>
    <span class="token punctuation">{</span>
        <span class="token constant">OnLine</span><span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token constant">OffLine</span><span class="token punctuation">,</span>
        <span class="token constant">Leave</span><span class="token punctuation">,</span>
        <span class="token constant">Busy</span><span class="token punctuation">,</span>
        <span class="token constant">QMe</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">class</span> <span class="token class-name">Program</span>
    <span class="token punctuation">{</span>
        static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x9009;&#x62E9;&#x4F60;&#x7684;QQ&#x5728;&#x7EBF;&#x72B6;&#x6001;&#xFF1A;1--Online 2--OffLine 3--Leave 4--Busy 5--QMe&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            string input <span class="token operator">=</span> <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            switch <span class="token punctuation">(</span>input<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                <span class="token keyword">case</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">:</span>
                    <span class="token constant">QQState</span> s1 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token constant">Enum</span><span class="token punctuation">.</span><span class="token constant">Parse</span><span class="token punctuation">(</span>typeof<span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token punctuation">,</span> input<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x60A8;&#x9009;&#x62E9;&#x7684;&#x5728;&#x7EBF;&#x72B6;&#x6001;&#x662F;{0}&quot;</span><span class="token punctuation">,</span> s1<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token keyword">case</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">:</span>
                    <span class="token constant">QQState</span> s2 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token constant">Enum</span><span class="token punctuation">.</span><span class="token constant">Parse</span><span class="token punctuation">(</span>typeof<span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token punctuation">,</span> input<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x60A8;&#x9009;&#x62E9;&#x7684;&#x5728;&#x7EBF;&#x72B6;&#x6001;&#x662F;{0}&quot;</span><span class="token punctuation">,</span> s2<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token keyword">case</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">:</span>
                    <span class="token constant">QQState</span> s3 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token constant">Enum</span><span class="token punctuation">.</span><span class="token constant">Parse</span><span class="token punctuation">(</span>typeof<span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token punctuation">,</span> input<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x60A8;&#x9009;&#x62E9;&#x7684;&#x5728;&#x7EBF;&#x72B6;&#x6001;&#x662F;{0}&quot;</span><span class="token punctuation">,</span> s3<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token keyword">case</span> <span class="token string">&quot;4&quot;</span><span class="token punctuation">:</span>
                    <span class="token constant">QQState</span> s4 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token constant">Enum</span><span class="token punctuation">.</span><span class="token constant">Parse</span><span class="token punctuation">(</span>typeof<span class="token punctuation">(</span><span class="token constant">QQState</span><span class="token punctuation">)</span><span class="token punctuation">,</span> input<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span><span class="token string">&quot;&#x60A8;&#x9009;&#x62E9;&#x7684;&#x5728;&#x7EBF;&#x72B6;&#x6001;&#x662F;{0}&quot;</span><span class="token punctuation">,</span> s4<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%9B%9B%E5%8D%81-%E7%BB%93%E6%9E%84">&#x56DB;&#x5341;&#x3001;&#x7ED3;&#x6784;</h5>

<blockquote>
<p>&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x6211;&#x4EEC;&#x4E00;&#x6B21;&#x6027;&#x58F0;&#x660E;&#x591A;&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x53D8;&#x91CF;<br>
<strong>&#x8BED;&#x6CD5;&#xFF1A;</strong><br>
[public] &#xA0;struct &#xA0;&#x7ED3;&#x6784;&#x540D;<br>
{<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#x6210;&#x5458;; //&#x53D8;&#x91CF;<br>
}</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">namespace _02_secondDemo
<span class="token punctuation">{</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x58F0;&#x660E;&#x4E00;&#x4E2A;&#x7ED3;&#x6784;
    <span class="token keyword">public</span> struct <span class="token constant">Person</span>
    <span class="token punctuation">{</span>
        <span class="token keyword">public</span> string _name<span class="token punctuation">;</span> <span class="token operator">/</span><span class="token operator">/</span>&#x5B57;&#x6BB5;
        <span class="token keyword">public</span> int _age<span class="token punctuation">;</span>
        <span class="token keyword">public</span> <span class="token constant">Gender</span> _gender<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token operator">/</span><span class="token operator">/</span>&#x58F0;&#x660E;&#x4E00;&#x4E2A;&#x679A;&#x4E3E;
    <span class="token keyword">public</span> enum <span class="token constant">Gender</span>
    <span class="token punctuation">{</span>
        &#x7537;<span class="token punctuation">,</span>
        &#x5973;
    <span class="token punctuation">}</span>
    <span class="token keyword">class</span> <span class="token class-name">Program</span>
    <span class="token punctuation">{</span>
        static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token constant">Person</span> zsPerson<span class="token punctuation">;</span>
            zsPerson<span class="token punctuation">.</span>_name <span class="token operator">=</span> <span class="token string">&quot;&#x5F20;&#x4E09;&quot;</span><span class="token punctuation">;</span>
            zsPerson<span class="token punctuation">.</span>_age <span class="token operator">=</span> <span class="token number">18</span><span class="token punctuation">;</span>
            zsPerson<span class="token punctuation">.</span>_gender <span class="token operator">=</span><span class="token constant">Gender</span><span class="token punctuation">.</span>&#x7537;<span class="token punctuation">;</span>

            <span class="token constant">Person</span> lsPerson<span class="token punctuation">;</span>
            lsPerson<span class="token punctuation">.</span>_name <span class="token operator">=</span> <span class="token string">&quot;&#x674E;&#x56DB;&quot;</span><span class="token punctuation">;</span>
            lsPerson<span class="token punctuation">.</span>_age <span class="token operator">=</span> <span class="token number">19</span><span class="token punctuation">;</span>
            lsPerson<span class="token punctuation">.</span>_gender <span class="token operator">=</span> <span class="token constant">Gender</span><span class="token punctuation">.</span>&#x5973;<span class="token punctuation">;</span>

            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>zsPerson<span class="token punctuation">.</span>_name<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>lsPerson<span class="token punctuation">.</span>_name<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%9B%9B%E5%8D%81%E4%B8%80-%E6%95%B0%E7%BB%84%E7%9A%84%E5%AE%9A%E4%B9%89">&#x56DB;&#x5341;&#x4E00;&#x3001;&#x6570;&#x7EC4;&#x7684;&#x5B9A;&#x4E49;</h5>

<blockquote>
<p>&#x4E00;&#x6B21;&#x6027;&#x5B58;&#x50A8;&#x591A;&#x4E2A;&#x76F8;&#x540C;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;<br>
<strong>&#x8BED;&#x6CD5;:</strong><br>
<mark>&#x6570;&#x7EC4;&#x7C7B;&#x578B; [] &#x6570;&#x7EC4;&#x540D; = new &#x6570;&#x7EC4;&#x7C7B;&#x578B;[&#x6570;&#x7EC4;&#x957F;&#x5EA6;];</mark><br>
int&#x7C7B;&#x578B;&#x7684;&#x6570;&#x7EC4;&#xFF0C;&#x521D;&#x59CB;&#x503C;&#x90FD;&#x4E3A;0&#xFF1B;<br>
string&#x7C7B;&#x578B;&#x7684;&#x6570;&#x7EC4;&#xFF0C;&#x521D;&#x59CB;&#x503C;&#x90FD;&#x4E3A;null&#xFF1B;<br>
bool&#x7C7B;&#x578B;&#x7684;&#x6570;&#x7EC4;&#xFF0C;&#x521D;&#x59CB;&#x503C;&#x90FD;&#x4E3A;false&#xFF1B;<br>
&#x6570;&#x7EC4;&#x58F0;&#x660E;&#x4E4B;&#x540E;&#xFF0C;&#x957F;&#x5EA6;&#x5C31;&#x4E0D;&#x53EF;&#x6539;&#x53D8;&#x4E86;&#x3002;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int<span class="token punctuation">[</span><span class="token punctuation">]</span> nums <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">int</span><span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    string<span class="token punctuation">[</span><span class="token punctuation">]</span> str <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">string</span><span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    bool<span class="token punctuation">[</span><span class="token punctuation">]</span> bools <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">bool</span><span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> nums<span class="token punctuation">.</span><span class="token constant">Length</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> i<span class="token punctuation">;</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span><span class="token number">0</span> <span class="token number">1</span> <span class="token number">2</span> <span class="token number">3</span> <span class="token number">4</span>  <span class="token number">5</span> <span class="token number">6</span> <span class="token number">7</span> <span class="token number">8</span> <span class="token number">9</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>&#x58F0;&#x660E;&#x6570;&#x7EC4;&#x7684;&#x5176;&#x4ED6;&#x65B9;&#x5F0F;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">int<span class="token punctuation">[</span><span class="token punctuation">]</span> nums2 <span class="token operator">=</span> <span class="token punctuation">{</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">,</span> <span class="token number">9</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token operator">/</span><span class="token operator">/</span>&#x4E0B;&#x9762;&#x8FD9;&#x4E24;&#x79CD;&#x65B9;&#x5F0F;&#x592A;&#x9EBB;&#x70E6;&#x4E86;
int<span class="token punctuation">[</span><span class="token punctuation">]</span> nums3 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">int</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span> <span class="token punctuation">{</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
int<span class="token punctuation">[</span><span class="token punctuation">]</span> nums4 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token punctuation">{</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></pre><h5 class="mume-header" id="%E5%9B%9B%E5%8D%81%E4%BA%8C-%E6%95%B0%E7%BB%84%E7%9A%84%E5%BA%94%E7%94%A8">&#x56DB;&#x5341;&#x4E8C;&#x3001;&#x6570;&#x7EC4;&#x7684;&#x5E94;&#x7528;</h5>

<blockquote>
<p>1&#x3001;&#x6C42;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x6700;&#x5927;&#x503C;&#x3001;&#x6700;&#x5C0F;&#x503C;&#x3001;&#x548C;&#x3001;&#x5E73;&#x5747;&#x503C;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    int<span class="token punctuation">[</span><span class="token punctuation">]</span> nums <span class="token operator">=</span> <span class="token punctuation">{</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">,</span> <span class="token number">9</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
    <span class="token operator">/</span><span class="token operator">/</span>int max <span class="token operator">=</span> nums<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token operator">/</span><span class="token operator">/</span>int min <span class="token operator">=</span> nums<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    int max <span class="token operator">=</span> int<span class="token punctuation">.</span><span class="token constant">MinValue</span><span class="token punctuation">;</span>
    int min <span class="token operator">=</span> int<span class="token punctuation">.</span><span class="token constant">MaxValue</span><span class="token punctuation">;</span>
    int sum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    int avg <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> nums<span class="token punctuation">.</span><span class="token constant">Length</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token operator">/</span><span class="token operator">/</span>&#x6C42;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x6700;&#x5927;&#x503C;
        max <span class="token operator">=</span> nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">&gt;</span> max <span class="token operator">?</span> nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token punctuation">:</span> max<span class="token punctuation">;</span>
        <span class="token operator">/</span><span class="token operator">/</span>&#x6C42;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x6700;&#x5C0F;&#x503C;
        min <span class="token operator">=</span> nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">&lt;</span> min <span class="token operator">?</span> nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token punctuation">:</span> min<span class="token punctuation">;</span>
        <span class="token operator">/</span><span class="token operator">/</span>&#x5BF9;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x503C;&#x6C42;&#x548C;
        sum <span class="token operator">+</span><span class="token operator">=</span> nums<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token operator">/</span><span class="token operator">/</span>&#x6C42;&#x6570;&#x7EC4;&#x4E2D;&#x503C;&#x7684;&#x5E73;&#x5747;&#x503C;
        avg <span class="token operator">=</span> sum <span class="token operator">/</span> nums<span class="token punctuation">.</span><span class="token constant">Length</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">WriteLine</span><span class="token punctuation">(</span>$<span class="token string">&quot;&#x6570;&#x7EC4;&#x7684;&#x6700;&#x5927;&#x503C;&#x4E3A;{max}&#xFF0C;&#x6700;&#x5C0F;&#x503C;&#x4E3A;{min}&#xFF0C;&#x548C;&#x4E3A;{sum}&#xFF0C;&#x5E73;&#x5747;&#x503C;&#x4E3A;{avg}&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span>&#x6570;&#x7EC4;&#x7684;&#x6700;&#x5927;&#x503C;&#x4E3A;<span class="token number">9</span>&#xFF0C;&#x6700;&#x5C0F;&#x503C;&#x4E3A;<span class="token number">1</span>&#xFF0C;&#x548C;&#x4E3A;<span class="token number">45</span>&#xFF0C;&#x5E73;&#x5747;&#x503C;&#x4E3A;<span class="token number">5</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><blockquote>
<p>2&#x3001;&#x5BF9;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x503C;&#x8FDB;&#x884C;&#x53CD;&#x8F6C;</p>
</blockquote>
<pre data-role="codeBlock" data-info="ruby {.line-numbers}" class="language-ruby line-numbers">static void <span class="token constant">Main</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    string<span class="token punctuation">[</span><span class="token punctuation">]</span> str <span class="token operator">=</span> <span class="token punctuation">{</span> <span class="token string">&quot;&#x6211;&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;&#x662F;&quot;</span> <span class="token punctuation">,</span><span class="token string">&quot;&#x5C0F;&#x7B11;&#x6B8B;&#x8679;&quot;</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> str<span class="token punctuation">.</span><span class="token constant">Length</span> <span class="token operator">/</span> <span class="token number">2</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        string temp <span class="token operator">=</span> str<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">;</span>
        str<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> str<span class="token punctuation">[</span>str<span class="token punctuation">.</span><span class="token constant">Length</span> <span class="token operator">-</span> <span class="token number">1</span> <span class="token operator">-</span> i<span class="token punctuation">]</span><span class="token punctuation">;</span>
        str<span class="token punctuation">[</span>str<span class="token punctuation">.</span><span class="token constant">Length</span> <span class="token operator">-</span> <span class="token number">1</span> <span class="token operator">-</span> i<span class="token punctuation">]</span> <span class="token operator">=</span> temp<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> str<span class="token punctuation">.</span><span class="token constant">Length</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">Write</span><span class="token punctuation">(</span>str<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token constant">Console</span><span class="token punctuation">.</span><span class="token constant">ReadKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">/</span>&#x5C0F;&#x7B11;&#x6B8B;&#x8679; &#x662F; &#x6211;
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre><p><img src="logo.png?0.7604728274696719" alt></p>

      </div>
      
      
    
    
    
    
    
    
    
    
  
    </body></html>